mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
method ref: type parameter instantiation (IDEA-154645)
This commit is contained in:
+3
-1
@@ -54,7 +54,9 @@ public class MethodReferenceResolver implements ResolveCache.PolyVariantContextR
|
||||
final PsiElement element = reference.getReferenceNameElement();
|
||||
final boolean isConstructor = reference.isConstructor();
|
||||
if (element instanceof PsiIdentifier || isConstructor) {
|
||||
if (isConstructor && (containingClass.isEnum() || containingClass.hasModifierProperty(PsiModifier.ABSTRACT))) {
|
||||
if (isConstructor && (containingClass.isEnum() ||
|
||||
containingClass.hasModifierProperty(PsiModifier.ABSTRACT) ||
|
||||
containingClass instanceof PsiTypeParameter)) {
|
||||
return JavaResolveResult.EMPTY_ARRAY;
|
||||
}
|
||||
final PsiType functionalInterfaceType = getInterfaceType(reference);
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
class Test<T> {
|
||||
{
|
||||
Supplier<T> aNew = T::<error descr="Cannot resolve constructor 'T'">new</error>;
|
||||
}
|
||||
}
|
||||
+4
@@ -506,6 +506,10 @@ public class NewMethodRefHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testTypeParameterInstantiation() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user