Bug 3828 – A failure in AA literals

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2010-02-18T12:42:00Z
Last change time
2015-06-09T01:27:38Z
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2010-02-18T12:42:29Z
This works: void main() { int[string][] a1 = [["cc":0]]; } This doesn't work: void main() { int[string][] a2 = [["cc":0], ["DD":10]]; } Gives: test.d(3): Error: Integer constant expression expected instead of "cc" test.d(3): Error: Integer constant expression expected instead of "cc" Error: incompatible types for (([0]) ? (["DD":10])): 'int[1u]' and 'int[string]' test.d(3): Error: cannot implicitly convert expression ([(__error),(__error)]) of type int[2u] to int[string][] Error: cannot cast int to int[string] Error: cannot cast int to int[string]
Comment #1 by yebblies — 2012-02-02T22:55:29Z
Folded into issue 5448. *** This issue has been marked as a duplicate of issue 5448 ***