import java.util.List;
import org.checkerframework.checker.nullness.qual.NonNull;
class A {
List<A> attrs = or(x(), y());
<T> @NonNull T or(T nullableValue, T defaultValue) {
throw new UnsupportedOperationException();
}
List<A> x() {
throw new UnsupportedOperationException();
}
<T> List<T> y() {
throw new UnsupportedOperationException();
}
}
error: StructuralEqualityComparer: unexpected combination: type: [TYPEVAR class org.checkerframework.framework.type.AnnotatedTypeMirror$AnnotatedTypeVariable] capture#01 extends Object supertype: [DECLARED class org.checkerframework.framework.type.AnnotatedTypeMirror$AnnotatedDeclaredType] A
visitHistory = org.checkerframework.framework.type.StructuralEqualityVisitHistory@7b4b6dca
; The Checker Framework crashed. Please report the crash. Version: Checker Framework 3.42.0-eisop3-SNAPSHOT, branch master, 2024-02-04, commit 777b7dc.
Checker: class org.checkerframework.checker.nullness.KeyForSubchecker
Visitor: class org.checkerframework.common.basetype.BaseTypeVisitor
Compilation unit: A.java
Last visited tree at line 5 column 3:
List<A> attrs = or(x(), y());
Exception: java.lang.Throwable; java.lang.Throwable
at org.checkerframework.javacutil.BugInCF.<init>(BugInCF.java:22)
at org.checkerframework.framework.type.visitor.AtmComboVisitor.defaultAction(AtmComboVisitor.java:66)
at org.checkerframework.framework.type.StructuralEqualityComparer.defaultAction(StructuralEqualityComparer.java:58)
at org.checkerframework.framework.type.StructuralEqualityComparer.defaultAction(StructuralEqualityComparer.java:31)
at org.checkerframework.framework.type.visitor.AbstractAtmComboVisitor.visitTypevar_Declared(AbstractAtmComboVisitor.java:517)
at org.checkerframework.framework.util.AtmCombo.accept(AtmCombo.java:638)
at org.checkerframework.framework.type.StructuralEqualityComparer.areEqual(StructuralEqualityComparer.java:94)
at org.checkerframework.framework.type.StructuralEqualityComparer.areEqualInHierarchy(StructuralEqualityComparer.java:104)
at org.checkerframework.framework.type.DefaultTypeHierarchy.areEqualInHierarchy(DefaultTypeHierarchy.java:343)
at org.checkerframework.framework.type.DefaultTypeHierarchy.isContainedBy(DefaultTypeHierarchy.java:418)
at org.checkerframework.framework.type.DefaultTypeHierarchy.isContainedMany(DefaultTypeHierarchy.java:664)
at org.checkerframework.framework.type.DefaultTypeHierarchy.visitTypeArgs(DefaultTypeHierarchy.java:641)
at org.checkerframework.framework.type.DefaultTypeHierarchy.visitDeclared_Declared(DefaultTypeHierarchy.java:560)
at org.checkerframework.framework.type.DefaultTypeHierarchy.visitDeclared_Declared(DefaultTypeHierarchy.java:50)
at org.checkerframework.framework.util.AtmCombo.accept(AtmCombo.java:314)
at org.checkerframework.framework.type.DefaultTypeHierarchy.isSubtype(DefaultTypeHierarchy.java:263)
at org.checkerframework.framework.type.DefaultTypeHierarchy.isSubtype(DefaultTypeHierarchy.java:139)
at org.checkerframework.common.basetype.BaseTypeVisitor.commonAssignmentCheck(BaseTypeVisitor.java:3316)
at org.checkerframework.common.basetype.BaseTypeVisitor.commonAssignmentCheck(BaseTypeVisitor.java:3290)
at org.checkerframework.common.basetype.BaseTypeVisitor.commonAssignmentCheck(BaseTypeVisitor.java:3211)
at org.checkerframework.common.basetype.BaseTypeVisitor.visitVariable(BaseTypeVisitor.java:1660)
at org.checkerframework.common.basetype.BaseTypeVisitor.visitVariable(BaseTypeVisitor.java:195)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:990)
at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
at org.checkerframework.framework.source.SourceVisitor.scan(SourceVisitor.java:95)
at org.checkerframework.common.basetype.BaseTypeVisitor.scan(BaseTypeVisitor.java:442)
at org.checkerframework.common.basetype.BaseTypeVisitor.scan(BaseTypeVisitor.java:195)
at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:90)
at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:105)
at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:113)
at jdk.compiler/com.sun.source.util.TreeScanner.visitClass(TreeScanner.java:187)
at org.checkerframework.framework.source.SourceVisitor.visitClass(SourceVisitor.java:101)
at org.checkerframework.common.basetype.BaseTypeVisitor.processClassTree(BaseTypeVisitor.java:646)
at org.checkerframework.common.basetype.BaseTypeVisitor.visitClass(BaseTypeVisitor.java:601)
at org.checkerframework.common.basetype.BaseTypeVisitor.visitClass(BaseTypeVisitor.java:195)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:808)
at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:56)
at org.checkerframework.framework.source.SourceVisitor.visit(SourceVisitor.java:89)
at org.checkerframework.framework.source.SourceChecker.typeProcess(SourceChecker.java:1136)
at org.checkerframework.common.basetype.BaseTypeChecker.typeProcess(BaseTypeChecker.java:556)
at org.checkerframework.common.basetype.BaseTypeChecker.typeProcess(BaseTypeChecker.java:549)
at org.checkerframework.javacutil.AbstractTypeProcessor$AttributionTaskListener.finished(AbstractTypeProcessor.java:193)
at jdk.compiler/com.sun.tools.javac.api.ClientCodeWrapper$WrappedTaskListener.finished(ClientCodeWrapper.java:828)
at jdk.compiler/com.sun.tools.javac.api.MultiTaskListener.finished(MultiTaskListener.java:132)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1415)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1372)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:972)
at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:311)
at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:170)
at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57)
at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43)
(with similar exception stack traces for the other visitors)
We just tested an import of https://github.com/eisop/checker-framework/commit/faf33e68377774fa276fad8e8717b8bfee48c42a and https://github.com/eisop/checker-framework/commit/ddae9715ce32cc0ae115baf039699fa1f13a8e9e, and we're seeing this crash:
(with similar exception stack traces for the other visitors)