[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 10:21:24 PDT 2015


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

--- Comment #9 from Denis Shelomovskij <verylonglogin.reg at gmail.com> ---
(In reply to Kenji Hara from comment #8)
> (In reply to Martin Nowak from comment #7)
> > So what's the conclusion here?
> 
> Denis argues that mutable key char[] should be allowed for the AA indexing.
> But AA key should be const on indexing, and should be immutable on setting.
> Therefore specifying mutable key char[] is not possible.

Everything I want is to clarify AA behviour (emn... no, really I'd like to
remove this from a language as a terrible misfeature, but I'm almost alone here
so I do not propose it).
Regarging to types accepted by AAs I'd like Issue 12491 & Issue 12492 to be
discussed and resolved some way.

> (I'm saying if and only if a NewExpression `new char[1]` is directly used,
> it can be convertible to immutable(char[]) by the uniqueness. But it's
> different from his intention.)

This issue isn't connected with `immutable` at all. As I wrote in description
it's just a misleading error mesage. Go to enhancement Issue 12491 for AA and
immutability discussion.

> Therefore this issue should be closed as invalid.

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

--


More information about the Digitalmars-d-bugs mailing list