[Issue 11221] New: C-style struct literals in associative array literals too
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Oct 10 14:04:33 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11221
Summary: C-style struct literals in associative array literals
too
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Severity: enhancement
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2013-10-10 14:04:33 PDT ---
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
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list