You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@NullMarkedclassSampleNullUnmarkedCall {
@NullUnmarkedstaticclassFoo<T> {
Foo(Tt) {}
static <U> Foo<U> id(Uu) { returnnewFoo<>(u); }
}
staticvoidtest() {
// should report no errorFoo<@NullableObject> x = Foo.id(null);
}
}
Here, since Foo is @NullUnmarked, we can infer @Nullable Object as the type argument for the Foo.id(null) call, even though U (and T) do not have explicit @Nullable upper bounds.
The text was updated successfully, but these errors were encountered:
Example:
Here, since
Foo
is@NullUnmarked
, we can infer@Nullable Object
as the type argument for theFoo.id(null)
call, even thoughU
(andT
) do not have explicit@Nullable
upper bounds.The text was updated successfully, but these errors were encountered: