Bug 20789 – is(T: U) doesn't exclude deprecated alias calls with -de
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2020-04-30T13:12:54Z
Last change time
2020-05-12T11:46:44Z
Keywords
pull
Assigned to
No Owner
Creator
FeepingCreature
Comments
Comment #0 by default_357-line — 2020-04-30T13:12:54Z
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 by dlang-bot — 2020-04-30T14:06:11Z
@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 by dlang-bot — 2020-05-12T11:46:44Z
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