8193142: Regression: ClassCastException: Type$ErrorType cannot be cast to Type$ArrayType

Reviewed-by: mcimadamore
This commit is contained in:
Srikanth Adayapalam 2017-12-12 18:40:31 +05:30
parent 2f125c1bd5
commit ac4e5933a6
3 changed files with 10 additions and 3 deletions

View File

@ -4238,9 +4238,6 @@ public class Attr extends JCTree.Visitor {
public void visitTypeArray(JCArrayTypeTree tree) {
Type etype = attribType(tree.elemtype, env);
Type type = new ArrayType(etype, syms.arrayClass);
if (etype.isErroneous()) {
type = types.createErrorType(type);
}
result = check(tree, type, KindSelector.TYP, resultInfo);
}

View File

@ -0,0 +1,8 @@
/*
* @test /nodynamiccopyright/
* @bug 8193142
* @summary Regression: ClassCastException: Type$ErrorType cannot be cast to Type$ArrayType
* @compile/fail/ref=ElementTypeMissingTest.out -XDrawDiagnostics -XDdev ElementTypeMissingTest.java
*/
public class ElementTypeMissingTest { void m(Unkn... own) { } }

View File

@ -0,0 +1,2 @@
ElementTypeMissingTest.java:8:46: compiler.err.cant.resolve.location: kindname.class, Unkn, , , (compiler.misc.location: kindname.class, ElementTypeMissingTest, null)
1 error