February 24, 2011 [Issue 5651] New: Named enum doesn't work with associative arrays | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=5651 Summary: Named enum doesn't work with associative arrays Product: D Version: D2 Platform: Other OS/Version: Windows Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: andrej.mitrovich@gmail.com --- Comment #0 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2011-02-24 14:20:01 PST --- // Ok enum : int[string] { Circle = ["CoolCircle":50] } // Error: non-constant expression ["CoolCircle":50] enum shapes : int[string] { Circle = ["CoolCircle":50] } Tested on XP32 && Ubuntu32. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 05, 2012 [Issue 5651] Named enum doesn't work with associative arrays | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrej Mitrovic | http://d.puremagic.com/issues/show_bug.cgi?id=5651 yebblies <yebblies@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |yebblies@gmail.com Resolution| |INVALID --- Comment #1 from yebblies <yebblies@gmail.com> 2012-02-05 15:47:17 EST --- Not a bug, the first declaration is essentially a horrible way to write: enum int[string] Circle = ["CoolCircle":50]; While the second is an enum declaration, and enums do not support AAs as a base type. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation