"Andrei Alexandrescu" <[email protected]> wrote in message 
news:[email protected]...
>
> The Java7 syntax looks meaningful to me, too - you want to catch the union 
> type. A possibility that wouldn't change the language for us would be to 
> catch Algebraic!(Ex1, Ex2).
>

I'd argue that a templated catch block would be better so you wouldn't have 
to query what type it is in order to use it:

// With a little compler magic:
catch(TypeTuple!(Ex1, Ex2) e)
{
    writeln(e.msg); // Look ma, no querying!
}

// Mimicking D1-style template contraints:
catch(E : Ex1, Ex2)(E e)
{
    writeln(e.msg);
}



Reply via email to