I personally don't care too much for this, and would've much preferred if it happened the other way around (i.e. this is always an error). However, there seemingly are users that want this feature, so I propose that we make it controlled with EnableExplicit/DisableExplicit. Existing code can be updated with no issue (extra checks hurt nothing, can easily be removed, but not enough can crash hard). And I assume that if someone's already not using Explicit, they want to suffer...PureBasic - History wrote: - Changed : the way the map elements are created when using passive syntax, to be more consistent
Make map key explicit creation be controlled by EnableExplicit
Make map key explicit creation be controlled by EnableExplicit
In PB 6.00, this change was implemented:

Re: Make map key explicit creation be controlled by EnableExplicit
+1
If I'm accessing a non-existing key, I'd want to be warned by debugger, and I suppose when compiled, it could try to access it, and risk crashing like trying to access an out of bounds array element.
Making new keys implicitly just means I can easily run into difficult to find bugs if I misspell the key, and instead of being warned about it, PB pretends as if it were always there.
If I'm accessing a non-existing key, I'd want to be warned by debugger, and I suppose when compiled, it could try to access it, and risk crashing like trying to access an out of bounds array element.
Making new keys implicitly just means I can easily run into difficult to find bugs if I misspell the key, and instead of being warned about it, PB pretends as if it were always there.

