November 15, 2006 [Issue 512] New: Assigning to constants in a forwarded constructor doesn't work | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=512 Summary: Assigning to constants in a forwarded constructor doesn't work Product: D Version: 0.174 Platform: PC URL: http://www.digitalmars.com/d/attribute.html OS/Version: Windows Status: NEW Keywords: rejects-valid, spec Severity: normal Priority: P4 Component: DMD AssignedTo: bugzilla@digitalmars.com ReportedBy: deewiant@gmail.com OtherBugsDependingO 511 nThis: Under the "Const Attribute" section, the spec contains code like the following: class C { const int a; const int b; this() { a = 3; b = 2; } this(int x) { this(); // ok, forwarding constructor } } However, this code does not compile, producing errors: asdf.d(11): constructor asdf.C.this missing initializer for const field a asdf.d(11): constructor asdf.C.this missing initializer for const field b It seems to me that there's no particular reason why this shouldn't work, so I'm tagging this as "rejects-valid" as well as "spec". -- |
April 21, 2007 [Issue 512] Assigning to constants in a forwarded constructor doesn't work | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=512 deewiant@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |DUPLICATE ------- Comment #1 from deewiant@gmail.com 2007-04-21 11:20 ------- 789 is a duplicate of this bug, but as it's the one that's been marked fixed I'll mark this as the duplicate. *** This bug has been marked as a duplicate of 789 *** -- |
Copyright © 1999-2021 by the D Language Foundation