[Issue 1062] New: Cannot catch typedef'd class

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 14 15:38:44 PDT 2007


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

           Summary: Cannot catch typedef'd class
           Product: D
           Version: 1.009
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: tomas at famolsen.dk


This wont compile:

typedef Exception TypedefException;

void main()
{
    try
    {
    }
    catch(TypedefException e)
    {
    }
}

Gives you:
Error: can only catch class objects, not 'TypedefException'

After a little discussion on IRC it seems there is an inconsistency as a class
derived from TypedefException will work just fine. Either both should work or
none of them should!


-- 



More information about the Digitalmars-d-bugs mailing list