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.
Comment #1 by greensunny12 — 2018-06-24T19:46:21Z
Comment #2 by github-bugzilla — 2018-06-27T14:05:47Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/e7cbc9d1acd290d1af1587ad3b0389667bc6091c Fix Issue 19022 - CTorFlow: Show the line of the duplicated initialization for const/immutable fields https://github.com/dlang/dmd/commit/033d324957ff5bee8e25c7335eab2c562d17e2b1 Merge pull request #8399 from wilzbach/fix-19022 Fix Issue 19022 - CTorFlow: Show the line of the duplicated initialization for const/immutable fields merged-on-behalf-of: Jacob Carlborg <[email protected]>