[Issue 19419] New: [REG2.080.1] @disabled this() will print wrong error if calling non-default constructor with wrong parameters
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Nov 21 15:25:39 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=19419
Issue ID: 19419
Summary: [REG2.080.1] @disabled this() will print wrong error
if calling non-default constructor with wrong
parameters
Product: D
Version: D2
Hardware: x86
OS: Windows
Status: NEW
Severity: regression
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: radu.racariu at gmail.com
The following:
```
struct B
{
@disable this();
this(string s)
{}
}
void main()
{
auto b = B(3);
}
```
Gives misleading error message:
Failure with output: onlineapp.d(11): Error: constructor `onlineapp.B.this` is
not callable because it is annotated with `@disable`
Previous release printed:
onlineapp.d(11): Error: none of the overloads of `__ctor` are callable using
argument types `(int)`, candidates are:
onlineapp.d(3): `onlineapp.B.this()`
onlineapp.d(5): `onlineapp.B.this(string s)`
Which were clear and helpful.
--
More information about the Digitalmars-d-bugs
mailing list