Bug 19022 – CTorFlow: Show the line of the duplicated initialization for const/immutable fields
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-06-24T19:24:58Z
Last change time
2018-06-27T14:05:48Z
Keywords
diagnostic
Assigned to
No Owner
Creator
Seb
Comments
Comment #0 by greensunny12 — 2018-06-24T19:24:58Z
Currently this yields:
---
struct Foo
{
immutable int b;
this(int a)
{
b = 2;
b = 2;
}
}
---
foo.d(8): Error: immutable field b initialized multiple times
While in this case, it's easy to see where the error is, it can pretty complicated for complex constructor chains with mixins. Hence, it would be great to show the line of the previous declaration.