-
Bug
-
Resolution: Fixed
-
P2
-
7
-
b138
-
unknown
-
generic
-
Verified
As per latest JSR 334 EDR, types in a multi-catch statement should be pairwise disjoint, i.e. it is an error if for any two types Ti, Tj we have that Ti <: Tj or Tj <: Ti.
Here's the relevant EDR text:
"A catch clause must have exactly one parameter (which is called an exception parameter); the declared type of the exception parameter can be a single class type or can be a disjunctive type (denoted with '|') between two or more class types (or alternatives). [...] It is a compile-time error if a disjunctive type contains two alternatives Di, Dj where Di is a subtype of Dj."
Here's the relevant EDR text:
"A catch clause must have exactly one parameter (which is called an exception parameter); the declared type of the exception parameter can be a single class type or can be a disjunctive type (denoted with '|') between two or more class types (or alternatives). [...] It is a compile-time error if a disjunctive type contains two alternatives Di, Dj where Di is a subtype of Dj."