-
Notifications
You must be signed in to change notification settings - Fork 349
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
Checker crash with pattern matching latest version #5047
Comments
Thanks for reporting the problem, and I am sorry you encountered the crash. I am not able to reproduce this problem using the master branch of the Checker Framework. I did not try it with version 3.21.2, though it is possible that 4c9c5d9 fixed the problem. Are you able to build the Checker Framework from its repository and test it? For completeness, this is the file I used to try to reproduce the problem. // Test case for issue #5047: https://tinyurl.com/cfissue/5047
import java.util.Objects;
import org.checkerframework.checker.nullness.qual.Nullable;
public class Issue5047 {}
class NumberParameterBuilder<T, U, V> {
@Nullable Object minimum;
@Nullable Object maximum;
public boolean equals(final @Nullable Object o) {
if (o instanceof NumberParameterBuilder<?, ?, ?> b) {
return super.equals(o)
&& Objects.equals(this.minimum, b.minimum)
&& Objects.equals(this.maximum, b.maximum);
} else {
return false;
}
}
} |
@tmarback Thanks for confirming. We are sorry you encountered the problem, but I'm glad it is now fixed. |
Updating to version 3.21.2 gives me a
AsSuperVisitor: type is not an erased subtype of supertype.
error and crashes the framework when using pattern matching on anObject
-type value. The full exception trace is here, and the code that caused the crash is the following:Based on the exception output, it seems to be flipping which is the subtype and which is the supertype. Also I would expect this to be reported as a normal error, not crash the framework.
The previous version (3.21.1) did not have this issue and finished normally.
The text was updated successfully, but these errors were encountered: