[Issue 16600] New: Wrong error message for ambiguous mutable/immutable constructor
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Thu Oct 6 11:45:59 PDT 2016
https://issues.dlang.org/show_bug.cgi?id=16600
Issue ID: 16600
Summary: Wrong error message for ambiguous mutable/immutable
constructor
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: andrei at erdani.com
For this code:
struct S {
this(string);
this(string) immutable;
}
void main() {
auto a = const(S)("abc");
}
the error message is:
t.d(7): Error: t.S.__ctor called with argument types (string) const matches
both:
t.d(2): t.S.this(string)
and:
t.d(3): t.S.this(string)
Should be:
t.d(7): Error: t.S.__ctor called with argument types (string) const matches
both:
t.d(2): t.S.this(string)
and:
t.d(3): t.S.this(string) immutable
--
More information about the Digitalmars-d-bugs
mailing list