PsiSubstitutor (MethodCandidateInfo currentMethod, JavaResolveResult resolveResult, PsiMethod method) { return resolveResult instanceof MethodCandidateInfo && method != null && !method.isConstructor() //constructor reference was erased ? ((MethodCandidateInfo)resolveResult).getSiteSubstitutor() : currentMethod != null ? currentMethod.getSiteSubstitutor() : PsiSubstitutor.EMPTY; }