[Issue 12420] [AA] Can't set associative array with array as key value using key type

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Jul 26 01:22:32 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=12420

Walter Bright <bugzilla at digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla at digitalmars.com

--- Comment #13 from Walter Bright <bugzilla at digitalmars.com> ---
The error message is correct. It's really not safe to have AA keys that are
mutable.

Yes, the compiler currently accepts const keys, and const keys are mutable by
other references. But that is the bug, not the error message about
immutability.

Kenji is also correct that a Unique reference, even if it is mutable, should
also be accepted. This can be implemented in the compiler by testing to see if
a mutable reference can be implicitly converted to mutable.

--


More information about the Digitalmars-d-bugs mailing list