void (@NotNull PsiMethodCallExpression methodCall, @NotNull MethodCandidateInfo resolveResult, @NotNull PsiMethod resolved, HighlightInfo.Builder highlightInfo) { PsiElement parent = PsiUtil.skipParenthesizedExprUp(methodCall.getParent()); PsiVariable variable = null; if (parent instanceof PsiVariable) { variable = (PsiVariable)parent; } else if (parent instanceof PsiAssignmentExpression) { PsiExpression lExpression = ((PsiAssignmentExpression)parent).getLExpression(); if (lExpression instanceof PsiReferenceExpression) { PsiElement resolve = ((PsiReferenceExpression)lExpression).resolve(); if (resolve instanceof PsiVariable) { variable = (PsiVariable)resolve; } } } if (variable != null) { PsiType rType = methodCall.getType(); if (rType != null && !variable.getType().isAssignableFrom(rType)) { PsiType expectedTypeByApplicabilityConstraints = resolveResult.getSubstitutor(false).substitute(resolved.getReturnType()); if (expectedTypeByApplicabilityConstraints != null && !variable.getType().isAssignableFrom(expectedTypeByApplicabilityConstraints) && PsiTypesUtil.allTypeParametersResolved(variable, expectedTypeByApplicabilityConstraints)) { HighlightFixUtil.registerChangeVariableTypeFixes(variable, expectedTypeByApplicabilityConstraints, methodCall, highlightInfo); } } } }