Bug 789 – const initialization in forwarding constructors doesn't work
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2007-01-03T11:16:00Z
Last change time
2014-02-15T13:22:12Z
Keywords
rejects-valid, spec
Assigned to
bugzilla
Creator
dlang-bugzilla
Comments
Comment #0 by dlang-bugzilla — 2007-01-03T11:16:16Z
Spec: http://www.digitalmars.com/d/attribute.html#const
Program:
class C
{
const int a;
this()
{
a = 3; // ok
}
this(int x)
{
this(); // ok, forwarding constructor
}
}
Compiler output:
C:\...\bugs>dmd const.d
const.d(10): constructor const.C.this missing initializer for const field a
Comment #1 by bugzilla — 2007-02-12T03:36:21Z
Fixed DMD 1.005
Comment #2 by matti.niemenmaa+dbugzilla — 2007-04-21T11:20:43Z
*** Bug 512 has been marked as a duplicate of this bug. ***