Bug 8777 – "final fields" in error messages

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2012-10-07T13:27:00Z
Last change time
2012-10-27T03:21:32Z
Keywords
diagnostic, pull
Assigned to
andrej.mitrovich
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2012-10-07T13:27:26Z
This is a correct error message: class Foo { final int[5] bar; this() {} } void main() {} temp.d(2): Error: variable temp.Foo.bar final cannot be applied to variable, perhaps you meant const? This is wrong: class Foo { const int[5] bar; this() {} } void main() {} DMD 2.061alpha: temp.d(3): Error: constructor temp.Foo.this missing initializer for final field bar I suggest to replace it with something like: temp.d(3): Error: constructor temp.Foo.this missing initializer for const field bar
Comment #1 by yebblies — 2012-10-27T03:21:32Z