Add @Nullable to a mismatched generic type argument

Proprietary

Adds @Nullable to a nested generic type argument when a variable initializer or return has a wider nested element nullness than its target (such as a List<@Nullable String> assigned into a List<String>) by adding @Nullable to the target's nested type argument. A generic container is invariant in its element nullness, so the mismatch is a NullAway error. Gated on JSpecify @NullMarked scope and applied only where the fix is local to a declaration this recipe owns (a variable initializer or a method return type); raw types, unresolved bases, arity mismatches, and the diamond new B<>() target are left unchanged. Idempotent.

io.moderne.nullability.AddNullableToMismatchedTypeArgument
mod run . --recipe=io.moderne.nullability.AddNullableToMismatchedTypeArgument

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.