mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 21:55:01 +07:00
IDEA-91626
This commit is contained in:
@@ -480,7 +480,9 @@ 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) {
|
||||
lastParmType = ((PsiCapturedWildcardType)lastParmType).getWildcard();
|
||||
}
|
||||
for (int i = parms.length - 1; i < args.length; i++) {
|
||||
PsiType argType = args[i];
|
||||
if (argType == null || !TypeConversionUtil.isAssignable(lastParmType, argType)) {
|
||||
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
class Test {
|
||||
interface A<T> {
|
||||
void _(T... t);
|
||||
}
|
||||
|
||||
static void foo(final A<?> bar) {
|
||||
bar._("");
|
||||
}
|
||||
static void foo1(final A<? extends String> bar) {
|
||||
bar._("");
|
||||
}
|
||||
|
||||
static void foo2(final A<? extends Integer> bar) {
|
||||
bar._<error descr="'_(capture<? extends java.lang.Integer>...)' in 'Test.A' cannot be applied to '(java.lang.String)'">("")</error>;
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
foo(new A<Integer>() {
|
||||
public void _(final Integer... t) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -192,6 +192,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testTypeArgumentsGivenOnAnonymousClassCreation() throws Exception { doTest(false); }
|
||||
public void _testIDEA94011() throws Exception { doTest(false); }
|
||||
public void testDifferentTypeParamsInOverloadedMethods() throws Exception { doTest(true); }
|
||||
public void testIDEA91626() throws Exception { doTest(true); }
|
||||
|
||||
public void testJavaUtilCollections_NoVerify() throws Exception {
|
||||
PsiClass collectionsClass = getJavaFacade().findClass("java.util.Collections", GlobalSearchScope.moduleWithLibrariesScope(getModule()));
|
||||
|
||||
Reference in New Issue
Block a user