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
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/5db8f5fefd836291c21604b270b4893c44d4ce1f Fixes Issue 8770 https://github.com/D-Programming-Language/dmd/commit/30a63578f8146cb5354994ac0b93a0c1f0123fac Merge pull request #1195 from AndrejMitrovic/Fix8770 Fix Issue 8770 - Wrong error line number with immutable field