Bug 5448 – Array of AAs literal doesn't work

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-01-13T02:53:00Z
Last change time
2015-06-09T05:11:46Z
Keywords
pull, rejects-valid
Assigned to
yebblies
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2011-01-13T02:53:00Z
This D2 program: void main() { pragma(msg, typeof([[1: 2]]).stringof); int[int][] aaa = [[1: 2]]; } DMD 2.051 prints: int[int][] test.d(3): Error: cannot use array to initialize int[int] test.d(3): Error: cannot implicitly convert expression ([(__error)]) of type int[int][] to int[int][] So the literal seems correctly recognized.
Comment #1 by andrej.mitrovich — 2011-01-16T14:55:56Z
But this works: void main() { pragma(msg, typeof([[1: 2]]).stringof); int[int][] aaa = [[1: 2]].dup; }
Comment #2 by yebblies — 2012-02-01T21:24:13Z
Comment #3 by yebblies — 2012-02-02T22:55:30Z
*** Issue 3828 has been marked as a duplicate of this issue. ***
Comment #4 by github-bugzilla — 2012-10-12T23:50:14Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/f1e11a6918747bd9de722ecf02a42233fda01e2b Issue 5448 - Array of AAs literal doesn't work When an assoc array literal is mistakenly parsed as an array literal, reinterpret it during semantic. https://github.com/D-Programming-Language/dmd/commit/042038f08c77a8566d5cf8e423b004c24ee7efc9 Merge pull request #683 from yebblies/issue5448 Issue 5448 - Array of AAs literal doesn't work
Comment #5 by k.hara.pg — 2012-10-13T02:07:23Z