Bug 6577 – 'Cannot initialize member' error line number

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-08-30T03:08:00Z
Last change time
2011-09-01T02:34:59Z
Keywords
diagnostic, patch
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2011-08-30T03:08:19Z
struct Foo { int x; this(int x_) { this.x = x_; } } void main() { const Foo* f = new Foo(1); f.x++; } DMD 2.055head gives no line number: Error: can only initialize const member x inside constructor
Comment #1 by yebblies — 2011-08-30T08:15:31Z
Comment #2 by bugzilla — 2011-08-30T15:05:59Z
Comment #3 by yebblies — 2011-09-01T02:34:59Z
I don't think this issue exists for D1, marking as fixed.