[Issue 9671] New: Getting class object typeid in CTFE is not supported

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 9 02:39:25 PST 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9671

           Summary: Getting class object typeid in CTFE is not supported
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: CTFE
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: k.hara.pg at gmail.com
            Blocks: 3789


--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2013-03-09 02:39:16 PST ---
This code should work.

class Class {}

bool test1()
{
    Object c = new Class;
    return typeid(c) is typeid(c);
}
static assert(test1() == true);
bool test2()
{
    Object c = new Class;
    Object o = new Object;
    return typeid(c) is typeid(o);
}
static assert(test2() == false);


This is necessary for class object comparison in CTFE.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list