Bug 19419 – [REG2.080.1] @disabled this() will print wrong error if calling non-default constructor with wrong parameters
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2018-11-21T15:25:39Z
Last change time
2018-11-25T10:25:37Z
Assigned to
No Owner
Creator
Radu Racariu
Comments
Comment #0 by radu.racariu — 2018-11-21T15:25:39Z
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.
Comment #1 by razvan.nitu1305 — 2018-11-22T13:52:13Z