-
Notifications
You must be signed in to change notification settings - Fork 437
AsSuperVisitor: type is not an erased subtype of supertype #3970
Copy link
Copy link
Labels
Description
import org.checkerframework.checker.nullness.qual.Nullable;
public class T {
public interface A<T extends A<T>> extends B<T> {}
public interface B<T extends B<T>> {
int f();
@Nullable T g();
}
void t(A<?> a) {
if (a.f() == 1) {
A<?> a2 = a.g();
}
}
}/checker-framework-3.8.0/checker/bin/javac -processor Nullness T.java
error: AsSuperVisitor: type is not an erased subtype of supertype.
type: B<T extends B<T extends B<T>>>
superType: A<? extends A<capture#725 extends A<capture#725 extends A<capture#725>>>>
; The Checker Framework crashed. Please report the crash.
Compilation unit: T.java
Last visited tree at line 14 column 7:
A<?> a2 = a.g();
Exception: java.lang.Throwable; java.lang.Throwable
at org.checkerframework.javacutil.BugInCF.<init>(BugInCF.java:27)
at org.checkerframework.framework.type.AsSuperVisitor.errorTypeNotErasedSubtypeOfSuperType(AsSuperVisitor.java:147)
at org.checkerframework.framework.type.AsSuperVisitor.visitDeclared_Declared(AsSuperVisitor.java:340)
at org.checkerframework.framework.type.AsSuperVisitor.visitDeclared_Declared(AsSuperVisitor.java:29)
at org.checkerframework.framework.util.AtmCombo.accept(AtmCombo.java:314)
at org.checkerframework.framework.type.visitor.AbstractAtmComboVisitor.visit(AbstractAtmComboVisitor.java:65)
at org.checkerframework.framework.type.AsSuperVisitor.visit(AsSuperVisitor.java:96)
at org.checkerframework.framework.type.AsSuperVisitor.asSuper(AsSuperVisitor.java:78)
Reactions are currently unavailable