Bug 9520 – Wrong associative array literal interpretation

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2013-02-16T07:23:00Z
Last change time
2015-06-09T01:31:13Z
Keywords
rejects-valid
Assigned to
nobody
Creator
bearophile_hugs
See also
http://d.puremagic.com/issues/show_bug.cgi?id=4703

Comments

Comment #0 by bearophile_hugs — 2013-02-16T07:23:53Z
struct Foo { int[int][char] aa; } void main() { auto f1 = Foo( ['A': [0: 10, 2: 20]] ); // OK Foo f2 = { ['A': [0: 10, 1: 20]] }; // Error. } DMD 2.062beta gives: test.d(6): Error: cannot implicitly convert expression (['A':[10, 20]]) of type int[][char] to int[int][char] See also Issue 4703
Comment #1 by k.hara.pg — 2014-06-19T04:19:26Z
*** This issue has been marked as a duplicate of issue 6469 ***