PsiType (@NotNull MethodSignatureBackedByPsiMethod superMethodSignature, @NotNull MethodSignatureBackedByPsiMethod methodSignature, @NotNull PsiType superReturnType) { PsiType substitutedSuperReturnType; if (!superMethodSignature.isRaw() && superMethodSignature.equals(methodSignature)) { //see 8.4.5 PsiSubstitutor unifyingSubstitutor = MethodSignatureUtil.getSuperMethodSignatureSubstitutor(methodSignature, superMethodSignature); substitutedSuperReturnType = unifyingSubstitutor == null ? superReturnType : unifyingSubstitutor.substitute(superMethodSignature.getSubstitutor().substitute(superReturnType)); } else { substitutedSuperReturnType = TypeConversionUtil.erasure(superReturnType); } return substitutedSuperReturnType; }