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

AsSuperVisitor: type is not an erased subtype of supertype #6725

Closed
perceptron8 opened this issue Jul 25, 2024 · 3 comments · Fixed by #6805
Closed

AsSuperVisitor: type is not an erased subtype of supertype #6725

perceptron8 opened this issue Jul 25, 2024 · 3 comments · Fixed by #6805
Assignees
Labels

Comments

@perceptron8
Copy link

Please download and extract Common.java.zip.

Common.java is as simple as:

import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;

class Common {
	static <T> Iterable<T> prefix(Collection<? extends Iterable<? extends T>> iterables) {
		Collection<? extends Iterator<? extends T>> iterators = iterables.stream().map(Iterable::iterator).collect(Collectors.toList());
		// ...
		return List.of();
	}
}

Try to compile:

javac -processor nullness Common.java

You will get:

error: AsSuperVisitor: type is not an erased subtype of supertype.
  type: Object
  superType: Collection<? extends Iterator<? extends T extends Object>>
  ; The Checker Framework crashed.  Please report the crash.  Version: Checker Framework 3.45.0. 
  Compilation unit: Common.java
  Last visited tree at line 8 column 17:
                Collection<? extends Iterator<? extends T>> iterators = iterables.stream().map(Iterable::iterator).collect(Collectors.toList());
  Exception: java.lang.Throwable; java.lang.Throwable
        at org.checkerframework.javacutil.BugInCF.<init>(BugInCF.java:38)

(In reality, <T extends @Nullable Object>, but even with just <T>, CF crashes.)

@smillst smillst self-assigned this Jul 25, 2024
@smillst smillst added the crash label Jul 25, 2024
@pSub
Copy link
Contributor

pSub commented Aug 2, 2024

I see the same error when upgrading to 3.64.0 (previous versions crash prior due to #6664), see red6/dmn-check#290.

Because I somehow failed to find this issue, I already tried to create a minimal example that reproduces the crash. You can find it here https://github.com/pSub/reproduce-checker-framework-issue-6725. Maybe it helps. 😄

@smillst
Copy link
Member

smillst commented Aug 13, 2024

This test case is comment framework/tests/all-systems/Issue6725.java.

@pSub
Copy link
Contributor

pSub commented Sep 24, 2024

Thank you very much for this fix.

I built the checker-framework from the current master-Branch and was able to successfully run it on dmn-check for the first time since version 3.42.0 🚀 ❤️

Your hard work an dedication is appreciated.

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.

3 participants