Should masked exceptions be an error?

Denis Koroskin 2korden at gmail.com
Tue Nov 24 00:53:29 PST 2009


On Tue, 24 Nov 2009 10:30:30 +0300, Andrei Alexandrescu  
<SeeWebsiteForEmail at erdani.org> wrote:

> 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

Think so, too.



More information about the Digitalmars-d mailing list