Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8259235: javac crashes while attributing super method invocation
Reviewed-by: vromero
  • Loading branch information
Jan Lahoda committed Mar 3, 2021
1 parent bf90e85 commit 6d3c858cbbdfbeef2cf51f73599771e7f16ece2b
@@ -3782,7 +3782,7 @@ private List<Type> pruneInterfaces(Type t) {
for (Type t1 : types.interfaces(t)) {
boolean shouldAdd = true;
for (Type t2 : types.directSupertypes(t)) {
if (t1 != t2 && types.isSubtypeNoCapture(t2, t1)) {
if (t1 != t2 && !t2.hasTag(ERROR) && types.isSubtypeNoCapture(t2, t1)) {
shouldAdd = false;
}
}
@@ -0,0 +1,15 @@
/**
* @test /nodynamiccopyright/
* @bug 8259235
* @summary Invocation of a method from a superinterface in a class that has an erroneous supertype
* should not crash javac.
* @compile/fail/ref=SuperMethodCallBroken.out -XDdev -XDrawDiagnostics SuperMethodCallBroken.java
*/
public abstract class SuperMethodCallBroken extends Undef implements I, java.util.List<String> {
public void test() {
I.super.test();
}
}
interface I {
public default void test() {}
}
@@ -0,0 +1,2 @@
SuperMethodCallBroken.java:8:53: compiler.err.cant.resolve: kindname.class, Undef, ,
1 error

0 comments on commit 6d3c858

Please sign in to comment.