[Issue 2954] [tdpl] Allow to set associative array key value only using expression AA key type is constructable from

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Aug 9 07:23:07 PDT 2014


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

--- Comment #11 from hsteoh at quickfur.ath.cx ---
Which of the following cases should/shouldn't be valid?

Case 1:

int[string] aa;
char[] key;
aa[key] = 1;

Case 2:

int[string] aa;
char[] key;
if (aa[key] == 1) { ... }
auto p = key in aa;


It seems to me that we should allow case 2, but prohibit case 1.

--


More information about the Digitalmars-d-bugs mailing list