提交 c75371d2 编写于 作者: V vromero

8026963: type annotations code crashes for code with erroneous trees

Reviewed-by: jjg, jlahoda
上级 335aef8c
......@@ -4602,9 +4602,8 @@ public class Attr extends JCTree.Visitor {
validateAnnotatedType(t, t.type);
}
repeat = false;
} else if (enclTr.getKind() == JCTree.Kind.PRIMITIVE_TYPE) {
// This happens in test TargetTypeTest52.java
// Is there anything to do?
} else if (enclTr.getKind() == JCTree.Kind.PRIMITIVE_TYPE ||
enclTr.getKind() == JCTree.Kind.ERRONEOUS) {
repeat = false;
} else {
Assert.error("Unexpected tree: " + enclTr + " with kind: " + enclTr.getKind() +
......
/*
* @test /nodynamiccopyright/
* @bug 8026963
* @summary type annotations code crashes for lambdas with void argument
* @compile/fail/ref=TypeAnnotationsCrashWithErroneousTreeTest.out -XDrawDiagnostics -XDshouldStopPolicy=FLOW TypeAnnotationsCrashWithErroneousTreeTest.java
*/
public class TypeAnnotationsCrashWithErroneousTreeTest {
private void t(this) {}
}
TypeAnnotationsCrashWithErroneousTreeTest.java:9:20: compiler.err.illegal.start.of.type
1 error
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册