mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix erasure of captures special case, not valid anymore for new compilers (IDEA-131348)
(cherry picked from commit 0f357add956c0340ce08c79a14c052007e53be86)
This commit is contained in:
@@ -17,6 +17,8 @@ package com.intellij.psi.util;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.projectRoots.JavaSdkVersion;
|
||||
import com.intellij.openapi.projectRoots.JavaVersionService;
|
||||
import com.intellij.openapi.roots.LanguageLevelProjectExtension;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.Key;
|
||||
@@ -512,7 +514,7 @@ public final class PsiUtil extends PsiUtilCore {
|
||||
PsiType lastParmType = getParameterType(lastParameter, languageLevel, substitutorForMethod);
|
||||
if (!(lastParmType instanceof PsiArrayType)) return ApplicabilityLevel.NOT_APPLICABLE;
|
||||
lastParmType = ((PsiArrayType)lastParmType).getComponentType();
|
||||
if (lastParmType instanceof PsiCapturedWildcardType) {
|
||||
if (lastParmType instanceof PsiCapturedWildcardType && !JavaVersionService.getInstance().isAtLeast(lastParameter, JavaSdkVersion.JDK_1_8)) {
|
||||
lastParmType = ((PsiCapturedWildcardType)lastParmType).getWildcard();
|
||||
}
|
||||
for (int i = parms.length - 1; i < args.length; i++) {
|
||||
|
||||
+2
-2
@@ -4,10 +4,10 @@ class Test {
|
||||
}
|
||||
|
||||
static void foo(final A<?> bar) {
|
||||
bar._("");
|
||||
bar._<error descr="Cannot resolve method '_(java.lang.String)'">("")</error>;
|
||||
}
|
||||
static void foo1(final A<? extends String> bar) {
|
||||
bar._("");
|
||||
bar._<error descr="Cannot resolve method '_(java.lang.String)'">("")</error>;
|
||||
}
|
||||
|
||||
static void foo2(final A<? extends Integer> bar) {
|
||||
|
||||
Reference in New Issue
Block a user