PsiSubstitutor (PsiTypeParameter @NotNull [] typeParameters, PsiType @NotNull [] leftTypes, PsiType @NotNull [] rightTypes, @NotNull PsiSubstitutor partialSubstitutor, @NotNull LanguageLevel languageLevel) { if (typeParameters.length == 0) return PsiSubstitutor.EMPTY; InferenceSession session = new InferenceSession(typeParameters, leftTypes, rightTypes, partialSubstitutor, myManager, null); for (PsiType leftType : leftTypes) { if (!session.isProperType(session.substituteWithInferenceVariables(leftType))) { return session.infer(); } } for (PsiType rightType : rightTypes) { if (!session.isProperType(session.substituteWithInferenceVariables(rightType))) { return session.infer(); } } return PsiSubstitutor.EMPTY; }