diff --git a/java/java-psi-api/src/com/intellij/codeInsight/daemon/impl/analysis/JavaGenericsUtil.java b/java/java-psi-api/src/com/intellij/codeInsight/daemon/impl/analysis/JavaGenericsUtil.java index 23164b15b4be..4e56bec0b86f 100644 --- a/java/java-psi-api/src/com/intellij/codeInsight/daemon/impl/analysis/JavaGenericsUtil.java +++ b/java/java-psi-api/src/com/intellij/codeInsight/daemon/impl/analysis/JavaGenericsUtil.java @@ -316,7 +316,6 @@ public final class JavaGenericsUtil { PsiSubstitutor superClassSubstitutor = TypeConversionUtil.getClassSubstitutor(owner, aClass, substitutor); if (superClassSubstitutor == null) return null; PsiType itemType = superClassSubstitutor.substitute(typeParameter); - itemType = PsiUtil.captureToplevelWildcards(itemType, aClass); return itemType == null ? PsiType.getJavaLangObject(manager, aClass.getResolveScope()) : itemType; } if (type instanceof PsiIntersectionType) { diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/DeconstructionInferenceTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/DeconstructionInferenceTest.java index 8e433ea0ea56..f97d6f202382 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/DeconstructionInferenceTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/DeconstructionInferenceTest.java @@ -214,11 +214,6 @@ public class DeconstructionInferenceTest extends LightJavaCodeInsightFixtureTest int length = text.length(); } } - public static void test2(List> records) { - for (Box(var x ) : records) { - System.out.println(x.isEmpty()); - } - } } """); myFixture.enableInspections(new RawUseOfParameterizedTypeInspection());