mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
new inference: exact method reference: decline constructor with parameter with type parameter of class
This commit is contained in:
+10
@@ -102,6 +102,16 @@ public class PsiMethodReferenceExpressionImpl extends PsiReferenceExpressionBase
|
||||
final PsiReferenceParameterList parameterList = getParameterList();
|
||||
return parameterList != null && parameterList.getTypeParameterElements().length > 0 ? psiMethod : null;
|
||||
}
|
||||
if (psiMethod.isConstructor() && containingClass.hasTypeParameters()) {
|
||||
final PsiElement qualifier = getQualifier();
|
||||
if (qualifier instanceof PsiTypeElement) {
|
||||
final PsiJavaCodeReferenceElement referenceElement = ((PsiTypeElement)qualifier).getInnermostComponentReferenceElement();
|
||||
if (referenceElement != null) {
|
||||
final PsiReferenceParameterList parameterList = referenceElement.getParameterList();
|
||||
return parameterList != null && parameterList.getTypeParameterElements().length > 0 ? psiMethod : null;
|
||||
}
|
||||
}
|
||||
}
|
||||
return psiMethod;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user