mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-21 22:11:40 +07:00
method references: error on wrong number of type arguments on static call (IDEA-205657)
This commit is contained in:
@@ -1415,9 +1415,13 @@ public class HighlightVisitorImpl extends JavaElementVisitor implements Highligh
|
||||
}
|
||||
}
|
||||
|
||||
if (!myHolder.hasErrorResults() && method instanceof PsiMethod && ((PsiMethod)method).hasModifierProperty(PsiModifier.STATIC)) {
|
||||
if (method instanceof PsiMethod && ((PsiMethod)method).hasModifierProperty(PsiModifier.STATIC)) {
|
||||
if (!myHolder.hasErrorResults() && ((PsiMethod)method).hasTypeParameters()) {
|
||||
myHolder.add(GenericsHighlightUtil.checkParameterizedReferenceTypeArguments(method, expression, result.getSubstitutor(), myJavaSdkVersion));
|
||||
}
|
||||
|
||||
PsiClass containingClass = ((PsiMethod)method).getContainingClass();
|
||||
if (containingClass != null && containingClass.isInterface()) {
|
||||
if (!myHolder.hasErrorResults() && containingClass != null && containingClass.isInterface()) {
|
||||
myHolder.add(HighlightMethodUtil.checkStaticInterfaceCallQualifier(expression, result, expression.getTextRange(), containingClass));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ class Test<T> {
|
||||
BlahBlah<String> blahBlah1 = test::<String>foo1;
|
||||
BlahBlah<String> blahBlah2 = <error descr="Static method referenced through non-static qualifier">test::<String>foo2</error>;
|
||||
BlahBlah<String> blahBlah3 = <error descr="Static method referenced through non-static qualifier">test::<String>foo3</error>;
|
||||
BlahBlah<String> blahBlah4 = Test::<error descr="Wrong number of type arguments: 2; required: 1"><String, String></error>foo3;
|
||||
BlahBlah<String> blahBlah5 = test::<String, String>foo1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user