Exception transparency
Neal Gafter
neal at gafter.com
Mon Jun 7 23:38:22 PDT 2010
On Mon, Jun 7, 2010 at 11:31 PM, Peter Levart <peter.levart at marand.si>wrote:
> Not introducing disjunctive types as 1st class citizens might be more
> confusing than introducing them. People might ask why they can catch an
> exception into a local variable but can't return it's value or assign it to
> a field. Be prepared for another round of déjà vu: why can't I do new A()
> where A is a type vaiable...
>
Because the type A doesn't necessarily have a public no-args constructor.
I suggest a more parallel question would be: why can't I declare a variable
of type Serializable&Comparable<? super Number>.
More information about the lambda-dev
mailing list