D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 19419 - [REG2.080.1] @disabled this() will print wrong error if calling non-default constructor with wrong parameters
Summary: [REG2.080.1] @disabled this() will print wrong error if calling non-default c...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P1 regression
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-21 15:25 UTC by RR
Modified: 2018-11-25 10:25 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description RR 2018-11-21 15:25:39 UTC
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 RazvanN 2018-11-22 13:52:13 UTC
PR: https://github.com/dlang/dmd/pull/8994
Comment 2 github-bugzilla 2018-11-25 10:25:33 UTC
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/837bbc2dfa98b413694352a2ce8a191bb706aa34
Fix Issue 19419 - [REG2.080.1] @disabled this() will print wrong error if calling non-default constructor with wrong parameters

https://github.com/dlang/dmd/commit/579dc9d455be817bf15aebf584f780b161c53f2f
Merge pull request #8994 from RazvanN7/Issue_19419

Fix Issue 19419 - [REG2.080.1] @disabled this() will print wrong error if calling non-default constructor with wrong parameters