Details
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8028835 | port-stage-ppc-aix | Eric Mccorkle | P2 | Resolved | Fixed | master |
Description
Javac 8b112 accepts the following code:
class Class<M extends Object[]> { }
As per JLS 7, 4.4. Type Variables
Grammar:
TypeParameter:
TypeVariable TypeBoundopt
TypeBound:
extends TypeVariable
extends ClassOrInterfaceType AdditionalBoundListopt
4.3. Reference Types and Values:
ReferenceType:
ClassOrInterfaceType
TypeVariable
ArrayType
This means ArrayType should not be allowed.
The following JCK tests fail:
lang/TYPE/type140/type14003m0/type14003m0.html
lang/TYPE/type140/type14003m1/type14003m1.html
lang/TYPE/type140/type14003m2/type14003m2.html
lang/TYPE/type140/type14003m3/type14003m3.html
lang/TYPE/type140/type14003m0/type14003m01.html
lang/TYPE/type140/type14003m1/type14003m11.html
lang/TYPE/type140/type14003m2/type14003m21.html
lang/TYPE/type140/type14003m3/type14003m31.html
class Class<M extends Object[]> { }
As per JLS 7, 4.4. Type Variables
Grammar:
TypeParameter:
TypeVariable TypeBoundopt
TypeBound:
extends TypeVariable
extends ClassOrInterfaceType AdditionalBoundListopt
4.3. Reference Types and Values:
ReferenceType:
ClassOrInterfaceType
TypeVariable
ArrayType
This means ArrayType should not be allowed.
The following JCK tests fail:
lang/TYPE/type140/type14003m0/type14003m0.html
lang/TYPE/type140/type14003m1/type14003m1.html
lang/TYPE/type140/type14003m2/type14003m2.html
lang/TYPE/type140/type14003m3/type14003m3.html
lang/TYPE/type140/type14003m0/type14003m01.html
lang/TYPE/type140/type14003m1/type14003m11.html
lang/TYPE/type140/type14003m2/type14003m21.html
lang/TYPE/type140/type14003m3/type14003m31.html
Attachments
Issue Links
- backported by
-
JDK-8028835 javac illegally accepts array as bound
- Resolved
- blocks
-
JDK-8027386 Compiler regression error on multi-level abstract generic class with intersection types
- Open
- is blocked by
-
JDK-8027738 Lambda Spec: Disallow arrays in intersection cast targets
- Closed