[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
Tue Mar 10 11:47:37 PDT 2015


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

Steven Schveighoffer <schveiguy at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schveiguy at yahoo.com

--- Comment #10 from Steven Schveighoffer <schveiguy at yahoo.com> ---
(In reply to Denis Shelomovskij from comment #9)

> I can't believe anyone can accept bahaviour shown in Comment 6.

I agree with you, and I have argued as much in the NG. The compiler should
either enforce immutability, or not care. Enforcing const has all of the
annoyance, with none of the guarantee.

However, practicality dictates that we cannot force immutability on everyone
who wants to use an AA. In particular, immutable classes are nearly useless.

I would like to see AA's remove the const enforcement. I'm not sure how I feel
about immutable enforcement, but it would be a nice option to add once AA's are
fully library types.

--


More information about the Digitalmars-d-bugs mailing list