diff --git a/java/java-impl/src/com/intellij/psi/scope/util/PsiScopesUtil.java b/java/java-impl/src/com/intellij/psi/scope/util/PsiScopesUtil.java index 7da267c2e1b5..284478d52f35 100644 --- a/java/java-impl/src/com/intellij/psi/scope/util/PsiScopesUtil.java +++ b/java/java-impl/src/com/intellij/psi/scope/util/PsiScopesUtil.java @@ -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(); diff --git a/java/java-tests/testData/codeInsight/completion/normal/IntersectionTypeMembers.java b/java/java-tests/testData/codeInsight/completion/normal/IntersectionTypeMembers.java new file mode 100644 index 000000000000..7a77c2d66117 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/normal/IntersectionTypeMembers.java @@ -0,0 +1,18 @@ +interface IA{ + void fooa(); +} + +interface IB{ + void foob(); +} + +interface IC{ + T c(); +} + +class K { + void foo(IC x){ + x.c().fo + + } +} \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/completion/NormalCompletionTest.groovy b/java/java-tests/testSrc/com/intellij/codeInsight/completion/NormalCompletionTest.groovy index 968c25cad396..753a551e8ec0 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/completion/NormalCompletionTest.groovy +++ b/java/java-tests/testSrc/com/intellij/codeInsight/completion/NormalCompletionTest.groovy @@ -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(); }