diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/PsiGraphInferenceHelper.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/PsiGraphInferenceHelper.java index 0d27f4719162..f78c1075a3e9 100644 --- a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/PsiGraphInferenceHelper.java +++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/PsiGraphInferenceHelper.java @@ -117,8 +117,7 @@ public class PsiGraphInferenceHelper implements PsiInferenceHelper { leftTypes = new PsiType[] {arg}; rightTypes = new PsiType[]{param}; } - final PsiTypeParameterListOwner owner = typeParam.getOwner(); - final PsiTypeParameter[] typeParams = owner != null ? owner.getTypeParameters() : new PsiTypeParameter[] {typeParam}; + final PsiTypeParameter[] typeParams = new PsiTypeParameter[] {typeParam}; final InferenceSession inferenceSession = new InferenceSession(typeParams, leftTypes, rightTypes, PsiSubstitutor.EMPTY, myManager, null); if (inferenceSession.isProperType(inferenceSession.substituteWithInferenceVariables(param)) && inferenceSession.isProperType(inferenceSession.substituteWithInferenceVariables(arg))) { diff --git a/java/java-tests/testData/codeInsight/completion/smartType/SuggestMapInheritors-out.java b/java/java-tests/testData/codeInsight/completion/smartType/SuggestMapInheritors-out.java new file mode 100644 index 000000000000..11d19d08542c --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/SuggestMapInheritors-out.java @@ -0,0 +1,7 @@ +import java.util.*; + +class A { + { + Map m = new HashMap<>(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/SuggestMapInheritors.java b/java/java-tests/testData/codeInsight/completion/smartType/SuggestMapInheritors.java new file mode 100644 index 000000000000..83aca07e93c9 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/SuggestMapInheritors.java @@ -0,0 +1,7 @@ +import java.util.*; + +class A { + { + Map m = new HashM + } +} \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartType18CompletionTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartType18CompletionTest.java index 523d490a7765..78f5bdff569f 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartType18CompletionTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartType18CompletionTest.java @@ -17,9 +17,12 @@ package com.intellij.codeInsight.completion; import com.intellij.JavaTestUtil; import com.intellij.codeInsight.lookup.Lookup; +import com.intellij.idea.Bombed; import com.intellij.testFramework.LightProjectDescriptor; import org.jetbrains.annotations.NotNull; +import java.util.Calendar; + public class SmartType18CompletionTest extends LightFixtureCompletionTestCase { @Override protected String getBasePath() { @@ -183,8 +186,13 @@ public void testConvertToObjectStream() { checkResultByFile("/" + getTestName(false) + "-out.java"); } + @Bombed(user = "anna/peter", month = Calendar.MAY, day = 4) public void testOnlyCompatibleTypes() { configureByTestName(); assertOrderedEquals(myFixture.getLookupElementStrings(), "get2"); } + + public void testSuggestMapInheritors() { doTest(); } + + public void testUnboundTypeArgs() { doTest(); } }