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

Crash in AbstractAtmComboVisitor: AnnotatedTypeMirrors aren't structurally equal. #4879

Closed
cushon opened this issue Aug 10, 2021 · 0 comments · Fixed by #4883
Closed

Crash in AbstractAtmComboVisitor: AnnotatedTypeMirrors aren't structurally equal. #4879

cushon opened this issue Aug 10, 2021 · 0 comments · Fixed by #4883
Assignees
Labels

Comments

@cushon
Copy link
Contributor

cushon commented Aug 10, 2021

I think this is the last distinct failure I'm seeing in my testing at head, with #4866 and #4875 patched in.

abstract class L<T> {
  protected L(A<T> c) {}
}

class A<T> {
  static class B<T> {
    public B() {}

    A<T> build() {
      throw new AssertionError();
    }
  }
}

class T {
  private final class I extends L<Object> {
    private I() {
      super(new A.B<>().build());
    }
  }
}
error: AnnotatedTypeMirrors aren't structurally equal.
    type1 = AnnotatedTypeVariable( T extends Object )
    type2 = AnnotatedDeclaredType( Object )
    visitHistory = org.checkerframework.framework.type.StructuralEqualityVisitHistory@181098bf
  ; The Checker Framework crashed.  Please report the crash.
  Compilation unit: T.java
  Last visited tree at line 18 column 7:
        super(new A.B<>().build());
  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:236)
        at org.checkerframework.framework.type.DefaultTypeHierarchy.isContainedBy(DefaultTypeHierarchy.java:311)
        at org.checkerframework.framework.type.DefaultTypeHierarchy.isContainedMany(DefaultTypeHierarchy.java:537)
        at org.checkerframework.framework.type.DefaultTypeHierarchy.visitTypeArgs(DefaultTypeHierarchy.java:507)
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