mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
wildcards in receiver type supported (IDEA-92699)
This commit is contained in:
@@ -637,7 +637,7 @@ public class LambdaUtil {
|
||||
}
|
||||
|
||||
public static boolean isReceiverType(PsiType receiverType, PsiClass containingClass, PsiSubstitutor psiSubstitutor) {
|
||||
final PsiClassType.ClassResolveResult resolveResult = PsiUtil.resolveGenericsClassInType(receiverType);
|
||||
final PsiClassType.ClassResolveResult resolveResult = PsiUtil.resolveGenericsClassInType(GenericsUtil.eliminateWildcards(receiverType));
|
||||
final PsiClass receiverClass = resolveResult.getElement();
|
||||
if (receiverClass != null && isReceiverType(receiverClass, containingClass)) {
|
||||
return resolveResult.getSubstitutor().equals(psiSubstitutor) ||
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
import java.util.*;
|
||||
|
||||
class MyTest2{
|
||||
{
|
||||
Comparator<? super String> comparator = String::compareToIgnoreCase;
|
||||
}
|
||||
}
|
||||
|
||||
class Test {
|
||||
void test() {
|
||||
Foo2<? extends Bar2> foo2 = Bar2::xxx;
|
||||
}
|
||||
}
|
||||
|
||||
interface Foo2<T> {
|
||||
void bar(T i, T j);
|
||||
}
|
||||
interface Bar2 {
|
||||
public void xxx(Bar2 p) default {}
|
||||
}
|
||||
+4
@@ -109,6 +109,10 @@ public class MethodRefHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testWildcards() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testInferenceFromReturnType() throws Exception {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user