Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AnnotatedTypeMirrors aren't structurally equal #4853

Closed
cushon opened this issue Aug 2, 2021 · 0 comments · Fixed by #4866
Closed

AnnotatedTypeMirrors aren't structurally equal #4853

cushon opened this issue Aug 2, 2021 · 0 comments · Fixed by #4866
Assignees
Labels

Comments

@cushon
Copy link
Contributor

cushon commented Aug 2, 2021

interface A<T> {}

class G<T> {
  class B implements A<T> {}
}

abstract class T extends G<Void> {
  protected void f() {
    g(new B());
  }

  abstract void g(A<Void> callback);
}
$ ./checker/bin/javac -processor Nullness T.java
error: AnnotatedTypeMirrors aren't structurally equal.
    type1 = AnnotatedTypeVariable( T extends Object )
    type2 = AnnotatedDeclaredType( Void )
    visitHistory = org.checkerframework.framework.type.StructuralEqualityVisitHistory@10f8e2d2
  ; The Checker Framework crashed.  Please report the crash.
  Compilation unit: T.java
  Last visited tree at line 9 column 5:
      g(new B());
  Exception: java.lang.Throwable; java.lang.Throwable
        at org.checkerframework.javacutil.BugInCF.<init>(BugInCF.java:22)
        at org.checkerframework.framework.type.visitor.AbstractAtmComboVisitor.defaultAction(AbstractAtmComboVisitor.java:52)
        at org.checkerframework.framework.type.StructuralEqualityComparer.defaultAction(StructuralEqualityComparer.java:56)
        at org.checkerframework.framework.type.StructuralEqualityComparer.defaultAction(StructuralEqualityComparer.java:29)
        at org.checkerframework.framework.type.visitor.AbstractAtmComboVisitor.visitTypevar_Declared(AbstractAtmComboVisitor.java:543)
        at org.checkerframework.framework.util.AtmCombo.accept(AtmCombo.java:587)
        at org.checkerframework.framework.type.StructuralEqualityComparer.areEqual(StructuralEqualityComparer.java:93)
        at org.checkerframework.framework.type.StructuralEqualityComparer.areEqualInHierarchy(StructuralEqualityComparer.java:105)
        at org.checkerframework.framework.type.DefaultTypeHierarchy.areEqualInHierarchy(DefaultTypeHierarchy.java:228)
        at org.checkerframework.framework.type.DefaultTypeHierarchy.isContainedBy(DefaultTypeHierarchy.java:303)
        at org.checkerframework.framework.type.DefaultTypeHierarchy.isContainedMany(DefaultTypeHierarchy.java:529)
        at org.checkerframework.framework.type.DefaultTypeHierarchy.visitTypeArgs(DefaultTypeHierarchy.java:499)
        at org.checkerframework.framework.type.DefaultTypeHierarchy.visitDeclared_Declared(DefaultTypeHierarchy.java:445)
        at org.checkerframework.framework.type.DefaultTypeHierarchy.visitDeclared_Declared(DefaultTypeHierarchy.java:45)
        at org.checkerframework.framework.util.AtmCombo.accept(AtmCombo.java:311)
        at org.checkerframework.framework.type.DefaultTypeHierarchy.isSubtype(DefaultTypeHierarchy.java:147)
        at org.checkerframework.checker.nullness.KeyForAnnotatedTypeFactory$KeyForTypeHierarchy.isSubtype(KeyForAnnotatedTypeFactory.java:152)
        at org.checkerframework.framework.type.DefaultTypeHierarchy.isSubtype(DefaultTypeHierarchy.java:123)
        at org.checkerframework.common.basetype.BaseTypeVisitor.commonAssignmentCheck(BaseTypeVisitor.java:2784)
        at org.checkerframework.common.basetype.BaseTypeVisitor.commonAssignmentCheck(BaseTypeVisitor.java:2761)
        at org.checkerframework.common.basetype.BaseTypeVisitor.checkArguments(BaseTypeVisitor.java:3289)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants