Revert "IJ-CR-102037 [java-inspections] IDEA-311705. Support type inference changes in Java 20 for foreach"

This reverts commit 6851fe36806ce5b26b729d1aa3a0bf7eec19c76c.

GitOrigin-RevId: 1204ac08b61235469f75bf3eea65bd59cb43788a
This commit is contained in:
Mikhail Pyltsin
2023-02-03 00:32:33 +00:00
committed by intellij-monorepo-bot
parent cb01ed8c62
commit 026f64952a
@@ -316,9 +316,7 @@ public final class JavaGenericsUtil {
PsiSubstitutor superClassSubstitutor = TypeConversionUtil.getClassSubstitutor(owner, aClass, substitutor);
if (superClassSubstitutor == null) return null;
PsiType itemType = superClassSubstitutor.substitute(typeParameter);
if (itemType != null) {
itemType = PsiUtil.captureToplevelWildcards(itemType, aClass);
}
itemType = PsiUtil.captureToplevelWildcards(itemType, aClass);
return itemType == null ? PsiType.getJavaLangObject(manager, aClass.getResolveScope()) : itemType;
}
if (type instanceof PsiIntersectionType) {