https://issues.dlang.org/show_bug.cgi?id=13495
Issue ID: 13495
Summary: DMD fails to call struct constructor with default args
when default constructor is @disabled
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: DMD
Assignee: [email protected]
Reporter: [email protected]
i think that calling struct constructor with omited default parameters should
be allowed even if struct has @disable this(). i.e. the following code should
work:
struct S {
int v;
@disable this ();
this (int n=42) { v = n; }
}
void main () {
auto s = S();
}
now compiler complains: "Error: constructor z03.S.this is not callable because
it is annotated with @disable". but here is another constructor that perfectly
fits.
--