www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14917] New: typeid(x) is typeid(y) returns different results

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

          Issue ID: 14917
           Summary: typeid(x) is typeid(y) returns different results
                    during ctfe
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: joeyemmons yahoo.com

void main()
{
    class A{}
    class B:A {}

    bool test(A a)
    {
        if(typeid(a) is typeid(B)) return true;
        return false;
    }
    bool rt = test(new B()); // TRUE
    enum ct = test(new B()); // FALSE
    assert(rt == ct); // FAILS 
}

--
Aug 13 2015