-
Enhancement
-
Resolution: Unresolved
-
P4
-
None
-
5.0, 6
-
Fix Understood
-
generic
-
generic
Consider the example in 5042462.
We have the following type variables:
<T, U extends T, V extends T>
The JLS (p463) defines lub in terms of the EST (erased supertype set).
EST(U) = {Object} and
EST(V) = {Object}.
Then EC = { Object } = MEC.
So lub(U,V) = Object.
It should be T.
We have the following type variables:
<T, U extends T, V extends T>
The JLS (p463) defines lub in terms of the EST (erased supertype set).
EST(U) = {Object} and
EST(V) = {Object}.
Then EC = { Object } = MEC.
So lub(U,V) = Object.
It should be T.
- duplicates
-
JDK-6557665 Type variables are erased during lub computation
- Closed
- relates to
-
JDK-6357966 parameters containing nested generic types avoid recursive calls
- Closed
-
JDK-6569277 inference: uninferred type args should follow their upper bounds
- Closed
-
JDK-5042462 Problem with least upper bound (lub) and type variables
- Closed