Should masked exceptions be an error?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Nov 23 23:30:30 PST 2009


Consider:

try {
    ...
} catch (Exception) {
    ...
} catch (StdioException) {
    ...
}

The second handler never matches because StdioException is a subclass of 
Exception, so the first handler will always match whatever the second 
matches.

Should that be a compile-time error? I think so.


Andrei



More information about the Digitalmars-d mailing list