mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-19 10:34:38 +02:00
8259235: javac crashes while attributing super method invocation
Reviewed-by: vromero
This commit is contained in:
parent
bf90e8574d
commit
6d3c858cbb
3 changed files with 18 additions and 1 deletions
|
@ -3782,7 +3782,7 @@ public class Resolve {
|
|||
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
|
Loading…
Add table
Add a link
Reference in a new issue