Right now, our generic method inference computes only the top-level nullability for each type variable of a generic method. Our assumption was that we could rely on javac to correctly compute the type arguments otherwise. But, as #1473 and #1574 show, sometimes this is not the case, and it makes sense: computing the nullability-enhanced type of an actual parameter (particularly for its type arguments) requires extra logic that javac doesn't include. While our hacks seem to hold up for now, eventually, we probably want to enhance generic method inference to compute full mappings from type variables to (nullability-enhanced) types to fix this properly, relying on javac types where appropriate but not always. This could be fixed alongside #1291 which will also require a re-working of inference.
Right now, our generic method inference computes only the top-level nullability for each type variable of a generic method. Our assumption was that we could rely on
javacto correctly compute the type arguments otherwise. But, as #1473 and #1574 show, sometimes this is not the case, and it makes sense: computing the nullability-enhanced type of an actual parameter (particularly for its type arguments) requires extra logic thatjavacdoesn't include. While our hacks seem to hold up for now, eventually, we probably want to enhance generic method inference to compute full mappings from type variables to (nullability-enhanced) types to fix this properly, relying onjavactypes where appropriate but not always. This could be fixed alongside #1291 which will also require a re-working of inference.