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

Viewpoint adaptation test checker: AsSuperVisitor: type is not an erased subtype of supertype. #863

Open
Ao-senXiong opened this issue Aug 19, 2024 · 0 comments

Comments

@Ao-senXiong
Copy link
Member

Ao-senXiong commented Aug 19, 2024

Taken from #433's comment, open a separate issue to keep track of this.

Command:

./checker/bin/javac -cp "framework/build/classes/java/main:framework/build/classes/java/test" -processorpath "checker/dist/che
cker.jar:framework/build/classes/java/test" -processor viewpointtest.ViewpointTestChecker  checker/tests/all-systems/Crash.java  

Code example:

package wildcards;

import wildcards.Crash.GenericAnnotatedTypeFactoryCrash;

public class Crash<Factory extends GenericAnnotatedTypeFactoryCrash<?, ?, ?, ?>> {
    public abstract static class GenericAnnotatedTypeFactoryCrash<
            Value extends CFAbstractValue<Value>,
            Store extends CFAbstractStore<Value, Store>,
            TransferFunction extends CFAbstractTransfer<Value, Store, TransferFunction>,
            FlowAnalysis extends CFAbstractAnalysis<Value, Store, TransferFunction>> {
        abstract Store getRegularExitStore();
    }

    static class CFAbstractValue<V extends CFAbstractValue<V>> {}

    static class CFAbstractStore<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>> {}

    abstract static class CFAbstractTransfer<
            V extends CFAbstractValue<V>,
            S extends CFAbstractStore<V, S>,
            T extends CFAbstractTransfer<V, S, T>> {}

    public abstract static class CFAbstractAnalysis<
            V extends CFAbstractValue<V>,
            S extends CFAbstractStore<V, S>,
            T extends CFAbstractTransfer<V, S, T>> {}

    void use(Factory atypeFactory) {
        CFAbstractStore<?, ?> exitStore = atypeFactory.getRegularExitStore();
    }
}

Error message:

error: AsSuperVisitor: type is not an erased subtype of supertype.
  type: @Top Object
  superType: @Top CFAbstractStore<? extends @Top Object, ? extends @Top Object>
  ; The Checker Framework crashed.  Please report the crash.  Version: Checker Framework 3.42.0-eisop5-SNAPSHOT, branch receivertype-nonnull, 2024-08-19, commit c807e63, dirty=true. 
  Checker: class viewpointtest.ViewpointTestChecker
  Visitor: class org.checkerframework.common.basetype.BaseTypeVisitor
  Compilation unit: checker/tests/all-systems/Crash.java
  Last visited tree at line 29 column 9:
          CFAbstractStore<?, ?> exitStore = atypeFactory.getRegularExitStore();
  Exception: java.lang.Throwable; java.lang.Throwable
        at org.checkerframework.javacutil.BugInCF.<init>(BugInCF.java:34)
        at org.checkerframework.framework.type.AsSuperVisitor.errorTypeNotErasedSubtypeOfSuperType(AsSuperVisitor.java:151)
        at org.checkerframework.framework.type.AsSuperVisitor.visitDeclared_Declared(AsSuperVisitor.java:345)
        at org.checkerframework.framework.type.AsSuperVisitor.visitDeclared_Declared(AsSuperVisitor.java:32)
        at org.checkerframework.framework.util.AtmCombo.accept(AtmCombo.java:315)
        at org.checkerframework.framework.type.visitor.AbstractAtmComboVisitor.visit(AbstractAtmComboVisitor.java:34)
        at org.checkerframework.framework.type.AsSuperVisitor.visit(AsSuperVisitor.java:109)
        at org.checkerframework.framework.type.AsSuperVisitor.asSuper(AsSuperVisitor.java:90)
        at org.checkerframework.framework.util.AnnotatedTypes.asSuper(AnnotatedTypes.java:120)
        at org.checkerframework.framework.util.AnnotatedTypes.castedAsSuper(AnnotatedTypes.java:156)
        at org.checkerframework.framework.type.DefaultTypeHierarchy.visitTypeArgs(DefaultTypeHierarchy.java:591)
        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:315)
        at org.checkerframework.framework.type.DefaultTypeHierarchy.isSubtype(DefaultTypeHierarchy.java:263)
        at org.checkerframework.framework.type.DefaultTypeHierarchy.visitWildcard_Type(DefaultTypeHierarchy.java:1312)
        at org.checkerframework.framework.type.DefaultTypeHierarchy.visitWildcard_Declared(DefaultTypeHierarchy.java:1074)
        at org.checkerframework.framework.type.DefaultTypeHierarchy.visitWildcard_Declared(DefaultTypeHierarchy.java:50)
        at org.checkerframework.framework.util.AtmCombo.accept(AtmCombo.java:685)
        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:1045)
        at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:86)
        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.scan(TreeScanner.java:111)
        at jdk.compiler/com.sun.source.util.TreeScanner.visitBlock(TreeScanner.java:272)
        at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1103)
        at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:86)
        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:96)
        at jdk.compiler/com.sun.source.util.TreeScanner.visitMethod(TreeScanner.java:224)
        at org.checkerframework.framework.source.SourceVisitor.visitMethod(SourceVisitor.java:113)
        at org.checkerframework.common.basetype.BaseTypeVisitor.visitMethod(BaseTypeVisitor.java:1095)
        at org.checkerframework.common.basetype.BaseTypeVisitor.visitMethod(BaseTypeVisitor.java:195)
        at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:953)
        at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:86)
        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:96)
        at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:111)
        at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:119)
        at jdk.compiler/com.sun.source.util.TreeScanner.visitClass(TreeScanner.java:203)
        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:860)
        at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:60)
        at org.checkerframework.framework.source.SourceVisitor.visit(SourceVisitor.java:89)
        at org.checkerframework.framework.source.SourceChecker.typeProcess(SourceChecker.java:1135)
        at org.checkerframework.common.basetype.BaseTypeChecker.typeProcess(BaseTypeChecker.java:556)
        at org.checkerframework.javacutil.AbstractTypeProcessor$AttributionTaskListener.finished(AbstractTypeProcessor.java:193)
        at jdk.compiler/com.sun.tools.javac.api.ClientCodeWrapper$WrappedTaskListener.finished(ClientCodeWrapper.java:854)
        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:1397)
        at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1354)
        at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:946)
        at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:317)
        at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:176)
        at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:64)
        at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:50)
1 error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant