[Issue 19022] New: CTorFlow: Show the line of the duplicated initialization for const/immutable fields
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Jun 24 19:24:58 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=19022
Issue ID: 19022
Summary: CTorFlow: Show the line of the duplicated
initialization for const/immutable fields
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: diagnostic
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: greensunny12 at gmail.com
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.
--
More information about the Digitalmars-d-bugs
mailing list