D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20789 - is(T: U) doesn't exclude deprecated alias calls with -de
Summary: is(T: U) doesn't exclude deprecated alias calls with -de
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P1 normal
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2020-04-30 13:12 UTC by FeepingCreature
Modified: 2020-05-12 11:46 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 FeepingCreature 2020-04-30 13:12:54 UTC
With -de, deprecated calls are errors. So this struct does not convert to string:

struct S
{
    string foo() { return "foo"; }
    
    deprecated alias foo this;
}

However, if we check:

static assert(!is(S : string));

We see that the compiler still falsely asserts that S is convertible to string.
Comment 1 Dlang Bot 2020-04-30 14:06:11 UTC
@FeepingCreature created dlang/dmd pull request #11081 "Fix issue 20789: -de should disable is(T : U) if T alias-this to U is deprecated" fixing this issue:

- Fix issue 20789: don't indicate deprecated alias this or alias this of deprecated symbol as implicit conversion in is() when -de (deprecations as errors) is on.

https://github.com/dlang/dmd/pull/11081
Comment 2 Dlang Bot 2020-05-12 11:46:44 UTC
dlang/dmd pull request #11081 "Fix issue 20789: -de should disable is(T : U) if T alias-this to U is deprecated unless in deprecated scope" was merged into master:

- d1cd1b9057934fa58a08c2f50e09805aacd7fc47 by Mathis Beer:
  Fix issue 20789: don't indicate deprecated alias this or alias this of deprecated symbol as implicit conversion in is() when -de (deprecations as errors) is on.

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