File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
nullaway/src/main/java/com/uber/nullaway/generics Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -472,22 +472,23 @@ public void checkTypeParameterNullnessForAssignability(
472472 List <Symbol .TypeVariableSymbol > typeParam = invokedMethodSymbol .getTypeParameters ();
473473 List <Type > newTypeArgument = new ArrayList <>();
474474
475- if (inferredTypes .containsKey (tree )) {
476- Map <Type , Type > genericNullness = inferredTypes .get (tree );
475+ if (inferredTypes .containsKey (rhsTree )) {
476+ Map <Type , Type > genericNullness = inferredTypes .get (rhsTree );
477477 for (int i = 0 ; i < typeParam .size (); i ++) {
478478 if (genericNullness .containsKey (typeParam .get (i ).type )) {
479479 var pType = typeParam .get (i ).type ;
480480 newTypeArgument .add (genericNullness .get (pType )); // replace type to inferred types
481481 }
482482 }
483+
484+ Type .ClassType classType = (Type .ClassType ) rhsType ;
485+ // create a new Type.ClassType that has inferred types
486+ rhsType =
487+ new Type .ClassType (
488+ classType .getEnclosingType (),
489+ com .sun .tools .javac .util .List .from (newTypeArgument ),
490+ classType .tsym );
483491 }
484- Type .ClassType classType = (Type .ClassType ) rhsType ;
485- // create a new Type.ClassType that has inferred types
486- rhsType =
487- new Type .ClassType (
488- classType .getEnclosingType (),
489- com .sun .tools .javac .util .List .from (newTypeArgument ),
490- classType .tsym );
491492 }
492493 }
493494
You can’t perform that action at this time.
0 commit comments