Files
Tagir Valeevandintellij-monorepo-bot c01c39b90c [java-dfa] IDEA-377694 Nullable incompatibilities (not sure). Calls with nullable supertypes
Separate write-nullability and read-nullability

GitOrigin-RevId: 54d1b3509f99732466feba2b3932cf334d1ed086
2025-10-06 11:23:47 +00:00

28 lines
841 B
Java

import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.NullUnmarked;
import org.jspecify.annotations.Nullable;
@NullMarked
class SuperTypeVariable {
<T extends @Nullable Object> void nullableBounded(
Lib<? super T> lib, T t, @Nullable T tUnionNull) {
lib.useT(<warning descr="Argument 'tUnionNull' might be null">tUnionNull</warning>);
lib.useT(t);
}
<T> void implicitlyObjectBounded(
Lib<? super T> lib, T t, @Nullable T tUnionNull) {
lib.useT(<warning descr="Argument 'tUnionNull' might be null">tUnionNull</warning>);
lib.useT(t);
}
<T> void noSuper(
Lib<T> lib, T t, @Nullable T tUnionNull) {
lib.useT(<warning descr="Argument 'tUnionNull' might be null">tUnionNull</warning>);
lib.useT(t);
}
interface Lib<T extends @Nullable Object> {
void useT(T t);
}
}