-
Notifications
You must be signed in to change notification settings - Fork 14
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
#738 breaks a handful of our tests #757
Comments
Interestingly, that error arises only(?) in locations that previously had this error, which we had suppressed:
I think I'm close to a self-contained repro, but I'm posting that little bit for now so that I can close a couple windows I have open about it :) |
import org.jspecify.annotations.NonNull;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
@NullMarked
class Eisop757 {
@SuppressWarnings("nullness:return.type.incompatible")
<T> @NonNull T nullCheck(@Nullable T reference) {
return reference;
}
void foo(Foo<? extends Bar<?>> foo) {
Bar<?> cell = nullCheck(foo.bar());
}
interface Foo<T extends Bar<T>> {
@Nullable T bar();
}
interface Bar<T> {}
}
|
The old error is gone, at least :) So #738 hasn't actually increased the number of errors, just changed the kind of error that we see, undoing our old suppressions. |
@cpovirk Sorry for not commenting on this (since a comment in a document when you filed this). I cannot reproduce a difference between before #738 and after. I also tried typetools release checker-framework-3.42.0. import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
class Eisop757 {
@SuppressWarnings("nullness:return.type.incompatible")
<T extends Object> @NonNull T nullCheck(@Nullable T reference) {
return reference;
}
void foo(Foo<? extends Bar<?>> foo) {
Bar<?> cell = nullCheck(foo.bar());
}
interface Foo<T extends Bar<T>> {
@Nullable T bar();
}
interface Bar<T extends Object> {}
} Are you using the CF Nullness Checker or the JSpecify reference checker? |
It looks to me like the
found
type meets the requirements of therequired
type, so I'm not sure exactly where the problem lies.I'll try to minimize that in the next couple days so that I can send you an actual repro.
The text was updated successfully, but these errors were encountered: