-
Bug
-
Resolution: Fixed
-
P4
-
9
-
b126
-
Verified
There are cases where instantiation shouldn't be used by the compiler like for inferring the parameterization of functional interfaces, avoiding instantiation for this case has uncovered the issue. In particular the part of the spec that is not implemented is the one concerning wildcards:
...
A constraint formula of the form ‹ S = T ›, where S and T are type arguments (§4.5.1),
is reduced as follows:
• If S and T are types, the constraint is reduced as described above.
• If S has the form ? and T has the form ? , the constraint reduces to true.
• If S has the form ? and T has the form ? extends T' , the constraint reduces to
‹ Object = T' ›.
• If S has the form ? extends S' and T has the form ? , the constraint reduces to
‹ S' = Object ›.
• If S has the form ? extends S' and T has the form ? extends T' , the constraint
reduces to ‹ S' = T' ›.
• If S has the form ? super S' and T has the form ? super T' , the constraint reduces
to ‹ S' = T' ›.
• Otherwise, the constraint reduces to false.
...
A constraint formula of the form ‹ S = T ›, where S and T are type arguments (§4.5.1),
is reduced as follows:
• If S and T are types, the constraint is reduced as described above.
• If S has the form ? and T has the form ? , the constraint reduces to true.
• If S has the form ? and T has the form ? extends T' , the constraint reduces to
‹ Object = T' ›.
• If S has the form ? extends S' and T has the form ? , the constraint reduces to
‹ S' = Object ›.
• If S has the form ? extends S' and T has the form ? extends T' , the constraint
reduces to ‹ S' = T' ›.
• If S has the form ? super S' and T has the form ? super T' , the constraint reduces
to ‹ S' = T' ›.
• Otherwise, the constraint reduces to false.
- blocks
-
JDK-8048543 JLS8 18.5.3: inference variable seems to be instantiated unexpectedly
-
- Closed
-
- relates to
-
JDK-8030148 Lambda Spec: Reduction for Foo<?> = Foo<? extends alpha>
-
- Closed
-
-
JDK-8162803 investigate type containment, type equality and their relationship
-
- Closed
-
-
JDK-8161277 javax.lang.model.util.Types.isSameType(...) returns true on wildcards
-
- Closed
-