(From ben-manes/caffeine#2004 (comment))
16 errors read "inference failure: type variable V constrained to be both @nonnull and @nullable",
concentrated in generic inference and wildcards. These were Caffeine's fault, not NullAway's.
CompletableFuture<T extends @Nullable Object> and BiFunction<T, U, R> with all three bounded by
@Nullable Object; Caffeine's helpers declared plain type variables, which bind to non-null
Object in null-marked code, so they could not accept those types at all. Widening the bounds
cleared all 16.
The diagnostic could point at this more directly. Adding an explicit type witness produces the
message that actually explains it:
Type argument cannot be @Nullable, as method <T,U,R>identity(...)'s type variable U is not @Nullable
whereas the inferred call says only that a type variable is "constrained to be both @nonnull and
@nullable", which reads like an inference defect rather than a missing bound on the user's own
declaration.
(From ben-manes/caffeine#2004 (comment))
16 errors read "inference failure: type variable V constrained to be both @nonnull and @nullable",
concentrated in generic inference and wildcards. These were Caffeine's fault, not NullAway's.
CompletableFuture<T extends @Nullable Object>andBiFunction<T, U, R>with all three bounded by@Nullable Object; Caffeine's helpers declared plain type variables, which bind to non-nullObjectin null-marked code, so they could not accept those types at all. Widening the boundscleared all 16.
The diagnostic could point at this more directly. Adding an explicit type witness produces the
message that actually explains it:
whereas the inferred call says only that a type variable is "constrained to be both @nonnull and
@nullable", which reads like an inference defect rather than a missing bound on the user's own
declaration.