[Issue 1285] New: Exception typedefs not distinguished by catch

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jun 22 19:51:09 PDT 2007


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

           Summary: Exception typedefs not distinguished by catch
           Product: D
           Version: 2.000
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: EH
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: paching at gmail.com


typedef Exception A;
typedef Exception B;

void main() {
  try {
    throw new A("test");
  }
  catch (B) {
    // this shouldn't happen, but does
  }
  catch (A) {
    // this ought to happen?
  }
}

Note, however, that dmd doesn't complain that the first catch masks the second,
unlike when I write "catch (Exception) {...} catch (A) {...}." Something's up!


-- 



More information about the Digitalmars-d-bugs mailing list