import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
@NullMarked
public class Test {
class A<X extends @Nullable Object> {
class B<Y extends @Nullable Object> {}
}
class C<X extends @Nullable Object> extends A<X> {
class D<Y extends @Nullable Object> extends A<X>.B<Y> {}
}
void test() {
C<@Nullable String> c = new C<>();
A<String>.B<@Nullable String> unused = c.new D<@Nullable String>();
}
}
We should warn at the final assignment due to incompatibility between A<String> and C<@Nullable String> but we currently do not. I think this is low priority compared to other open JSpecify issues.
We should warn at the final assignment due to incompatibility between
A<String>andC<@Nullable String>but we currently do not. I think this is low priority compared to other open JSpecify issues.