mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-57403 Completion cannot suggest members of an intersection type
This commit is contained in:
@@ -117,6 +117,10 @@ public class PsiScopesUtil {
|
||||
substitutor = substitutor.put(arrayTypeParameters[0], ((PsiArrayType)type).getComponentType());
|
||||
}
|
||||
arrayClass.processDeclarations(processor, ResolveState.initial().put(PsiSubstitutor.KEY, substitutor), arrayClass, place);
|
||||
} else if (type instanceof PsiIntersectionType) {
|
||||
for (PsiType psiType : ((PsiIntersectionType)type).getConjuncts()) {
|
||||
processTypeDeclarations(psiType, place, processor);
|
||||
}
|
||||
} else {
|
||||
final JavaResolveResult result = PsiUtil.resolveGenericsClassInType(type);
|
||||
final PsiClass clazz = (PsiClass)result.getElement();
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
interface IA{
|
||||
void fooa();
|
||||
}
|
||||
|
||||
interface IB{
|
||||
void foob();
|
||||
}
|
||||
|
||||
interface IC<T extends IA>{
|
||||
T c();
|
||||
}
|
||||
|
||||
class K {
|
||||
void foo(IC<? extends IB> x){
|
||||
x.c().fo<caret>
|
||||
|
||||
}
|
||||
}
|
||||
+5
@@ -786,6 +786,11 @@ public class NormalCompletionTest extends LightFixtureCompletionTestCase {
|
||||
checkResultByFile(getTestName(false) + "_after.java")
|
||||
}
|
||||
|
||||
public void testIntersectionTypeMembers() throws Throwable {
|
||||
configure()
|
||||
assertStringItems "fooa", "foob"
|
||||
}
|
||||
|
||||
public void testCastInstanceofedQualifier() throws Throwable { doTest(); }
|
||||
public void testCastComplexInstanceofedQualifier() throws Throwable { doTest(); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user