Should masked exceptions be an error?

Walter Bright newshound1 at digitalmars.com
Tue Nov 24 02:09:19 PST 2009


Andrei Alexandrescu wrote:
> Should that be a compile-time error? I think so.

=================================
class A : Exception
{
     this(string msg) { super(msg); }
}

void foo()
{
     try { }
     catch (Exception e) { }
     catch (A e) { }
}
=================================

gives:

test.d(9): Error: catch at test.d(10) hides catch at test.d(11)



More information about the Digitalmars-d mailing list