www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20789] New: is(T: U) doesn't exclude deprecated alias calls

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 puremagic.com
          Reporter: default_357-line 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.

--
Apr 30