-
Bug
-
Resolution: Fixed
-
P4
-
8
Per JLS 4.10.4, lub(List<? extends Exception>, List<? super Exception>) = List<Exception>.
lcta(? extends U, ? super V) = U if U = V, otherwise ?
This is not correct -- the result is not a supertype of either of the inputs. (Effectively this is computing a glb, not a lub.)
The right thing to do is to find a wildcard that includes the union of the ranges represented by two wildcards -- always an unbounded wildcard, '?'
lcta(? extends U, ? super V) = U if U = V, otherwise ?
This is not correct -- the result is not a supertype of either of the inputs. (Effectively this is computing a glb, not a lub.)
The right thing to do is to find a wildcard that includes the union of the ranges represented by two wildcards -- always an unbounded wildcard, '?'
- relates to
-
JDK-5052943 4.10.4: Improve lub for lower-bounded wildcards and variables
-
- Open
-