Unexpected range assignment behaviour

Dennis dkorpel at gmail.com
Fri Jul 19 17:48:37 UTC 2024


On Friday, 19 July 2024 at 17:20:22 UTC, matheus wrote:
> couldn't this case for example be caught during the compiling 
> time?

The RangeError is only thrown when at runtime, the key doesn't 
exist, so that can't be caught. The real problem is implicit 
slicing of static arrays, which I'm not a fan of, but removing it 
is a breaking change. So perhaps Associative Arrays should be 
enhanced to create keys on slice assignment.


More information about the Digitalmars-d-learn mailing list