[Issue 20789] New: is(T: U) doesn't exclude deprecated alias calls with -de

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Apr 30 13:12:54 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=20789

          Issue ID: 20789
           Summary: is(T: U) doesn't exclude deprecated alias calls with
                    -de
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: default_357-line at yahoo.de

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.

--


More information about the Digitalmars-d-bugs mailing list