An incorrect associative array work?
dark.hole1 at yandex.ru
Sat Sep 19 19:38:29 UTC 2020
Let's take a look at this code:
char buf = "abcd";
test[buf] = 1;
buf = "evil";
What we're expecting to see:
But real result is:
But if we replace static array with dynamic, we'll get error "key
must be immutable". Not exactly what we expected, but ok. If we
declare test as int[char], it works as expected.
So, is this behaviour bug?
More information about the Digitalmars-d