Bug 13496 – ArrayInitializer rule is redundant

Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P1
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-09-18T20:44:00Z
Last change time
2014-09-18T22:29:32Z
Keywords
spec
Assigned to
nobody
Creator
briancschott
Blocks
10233

Comments

Comment #0 by briancschott — 2014-09-18T20:44:24Z
auto a = [1:2]; Matches both the ArrayInitializer rule and the ExpInitializer rule because the ArrayInitializer rule is a copy of the AssocArrayLiteral and ArrayLiteral rules. I suggest removing the ArrayInitializer, ArrayMemberInitialization, and ArrayMemberInitializations rules from the language spec.
Comment #1 by bearophile_hugs — 2014-09-18T21:01:41Z
See Issue 4703
Comment #2 by briancschott — 2014-09-18T22:24:27Z
Never mind. You can't put a struct initializer inside of an array literal, so this won't work. Now if {} wasn't a function literal, we could just make struct initializers part of primary expressions and be done with it.