← Back to index
|
Original Bugzilla link
Bug 11221 – C-style struct literals in associative array literals too
Status
RESOLVED
Resolution
INVALID
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2013-10-10T14:04:33Z
Last change time
2021-01-24T07:26:24Z
Assigned to
No Owner
Creator
bearophile_hugs
Comments
Comment #0
by bearophile_hugs — 2013-10-10T14:04:33Z
struct MyStruct { int x; } void main() { MyStruct[string] aa1 = ["A": MyStruct(1), "B": MyStruct(2), "C": MyStruct(3)]; // OK MyStruct[string] aa2 = ["A": {1}, "B": {2}, "C" : {3}]; // Error } DMD 2.064 alpha gives: test.d(8): Error: not an associative array initializer
Comment #1
by maxhaton — 2021-01-24T07:26:24Z
Old + Invalid