[Issue 196] Static assertion involving typedef's base type fails strangely

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jun 23 14:36:58 PDT 2008


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


bugzilla at digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




------- Comment #2 from bugzilla at digitalmars.com  2008-06-23 16:36 -------
Thomas' code is almost correct. The correct code would be:

typedef int X;

static if (is(X base == typedef))
{
    static assert(is(base == int), "base of typedef X is not int");
}
else
{
    static assert(0, "X is not a typedef");
}


-- 



More information about the Digitalmars-d-bugs mailing list