Bug 8770 – Wrong error line number with immutable field
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2012-10-06T13:48:00Z
Last change time
2012-10-20T15:11:31Z
Keywords
diagnostic
Assigned to
andrej.mitrovich
Creator
bearophile_hugs
Comments
Comment #0 by bearophile_hugs — 2012-10-06T13:48:00Z
struct Foo {
immutable int bar = 1; // line 2
this(int x) {
this.bar = x;
}
}
void main() {}
Expected error:
temp.d(4): Error: this.bar is not mutable
But DMD 2.061alpha gives:
temp.d(2): Error: this.bar is not mutable
Comment #1 by github-bugzilla — 2012-10-20T15:10:32Z