D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20609 - Disabled and deprecated functions show up as candidate
Summary: Disabled and deprecated functions show up as candidate
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 enhancement
Assignee: No Owner
URL:
Keywords: diagnostic, pull
Depends on:
Blocks:
 
Reported: 2020-02-26 04:24 UTC by Mathias LANG
Modified: 2020-03-01 09:22 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Mathias LANG 2020-02-26 04:24:02 UTC
```
struct Foo
{
    @disable this();
    deprecated this(Object) {}
    this(string[] args) {}
}

void main()
{
    auto f = Foo(42);
}
```

As of DMD v2.090.1:
```
disabled.d(10): Error: none of the overloads of this are callable using argument types (int), candidates are:
disabled.d(3):        disabled.Foo.this()
disabled.d(4):        disabled.Foo.this(Object _param_0)
disabled.d(5):        disabled.Foo.this(string[] args)
```

The compiler shouldn't suggest disabled symbols, and probably not deprecated ones as well.
Fix on the way.
Comment 1 Dlang Bot 2020-02-26 09:24:04 UTC
@Geod24 created dlang/dmd pull request #10838 "Fix issue 20609 - Disabled and deprecated functions show up as candidate" fixing this issue:

- Fix issue 20609 - Disabled and deprecated functions show up as candidate
  
  Do not show disabled functions as candidate or hints.
  Only show deprecated functions when inside a deprecated scope.

https://github.com/dlang/dmd/pull/10838
Comment 2 Dlang Bot 2020-03-01 09:22:41 UTC
dlang/dmd pull request #10838 "Fix issue 20609 - Disabled and deprecated functions show up as candidate" was merged into master:

- fd548ddd2abded59f4c4511c8f12dc3f90913712 by Geod24:
  Fix issue 20609 - Disabled and deprecated functions show up as candidate
  
  Do not show disabled functions as candidate or hints.
  Only show deprecated functions when inside a deprecated scope.

https://github.com/dlang/dmd/pull/10838