Should masked exceptions be an error?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Nov 24 07:53:10 PST 2009


Walter Bright wrote:
> 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)

Great! Sorry, I don't have access to dmd.

Andrei.



More information about the Digitalmars-d mailing list