D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6577 - 'Cannot initialize member' error line number
Summary: 'Cannot initialize member' error line number
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 major
Assignee: No Owner
URL:
Keywords: diagnostic, patch
Depends on:
Blocks:
 
Reported: 2011-08-30 03:08 UTC by bearophile_hugs
Modified: 2011-09-01 02:34 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2011-08-30 03:08:19 UTC
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 3 yebblies 2011-09-01 02:34:59 UTC
I don't think this issue exists for D1, marking as fixed.