void (PsiVariable variable, PsiExpression value, PsiType migrationType, PsiSubstitutor varSubstitutor, PsiSubstitutor evalSubstitutor, boolean isCovariantPosition) { final TypeView right = new TypeView(value); final TypeView left = new TypeView(variable, varSubstitutor, evalSubstitutor); PsiType declarationType = left.getType(); switch (TypeInfection.getInfection(left, right)) { case NONE_INFECTED -> {} case LEFT_INFECTED -> { final PsiType valueType = right.getType(); if (valueType != null && declarationType != null) { myLabeler.migrateExpressionType(value, adjustMigrationTypeIfGenericArrayCreation(declarationType, value), myStatement, left.isVarArgs() ? isVarargAssignable(left, right) : TypeConversionUtil.isAssignable(declarationType, valueType), true); } } case RIGHT_INFECTED -> { PsiType psiType = migrationType != null ? migrationType : right.getType(); if (psiType != null) { if (canBeVariableType(psiType)) { if (declarationType != null) { boolean assignable = left.isVarArgs() ? isVarargAssignable(left, right) : TypeConversionUtil.isAssignable(declarationType, psiType); PsiType newType = left.isVarArgs() && !right.isVarArgs() ? new PsiEllipsisType(psiType) : psiType; if (!myLabeler.addMigrationRoot(variable, newType, myStatement, assignable, true) && !assignable) { if (declarationType instanceof PsiEllipsisType) { declarationType = ((PsiEllipsisType)declarationType).getComponentType(); } myLabeler.convertExpression(value, psiType, declarationType, isCovariantPosition); } } } else { if (variable instanceof PsiLocalVariable) { final PsiDeclarationStatement decl = PsiTreeUtil.getParentOfType(variable, PsiDeclarationStatement.class); if (decl != null && decl.getDeclaredElements().length == 1) { tryToRemoveLocalVariableAssignment((PsiLocalVariable)variable, value, psiType); } } } } } case BOTH_INFECTED -> addTypeUsage(variable); } }