digitalmars.D.bugs - [Issue 10530] New: Initializers inside named enum declarations cannot forward reference other members
- d-bugmail puremagic.com (21/21) Jul 03 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10530
- d-bugmail puremagic.com (10/10) Jul 03 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10530
- d-bugmail puremagic.com (11/11) Jul 03 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10530
http://d.puremagic.com/issues/show_bug.cgi?id=10530 Summary: Initializers inside named enum declarations cannot forward reference other members Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: timon.gehr gmx.ch DMD 2.063/git head: enum X {foo=0, bar=foo} // ok enum Y {foo=bar, bar=0} // error Both lines should compile. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 03 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10530 Actually it might be fine for the second line to be in error, since the compiler cannot easily figure out the enum base type in the general case when such a constellation is present. This should certainly work though: enum Y : int {foo=bar, bar=0} -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 03 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10530 Andrej Mitrovic <andrej.mitrovich gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrej.mitrovich gmail.com 13:46:36 PDT --- However this shouldn't work: enum Y : int {foo=bar, bar} -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 03 2013