mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
method applicability: do not check erased types if method was not called on raw type (IDEA-104992)
This commit is contained in:
@@ -466,7 +466,8 @@ public final class PsiUtil extends PsiUtilCore {
|
||||
final PsiParameter[] parms = method.getParameterList().getParameters();
|
||||
if (args.length < parms.length - 1) return ApplicabilityLevel.NOT_APPLICABLE;
|
||||
|
||||
final boolean isRaw = isRawSubstitutor(method, substitutorForMethod);
|
||||
final PsiClass containingClass = method.getContainingClass();
|
||||
final boolean isRaw = containingClass != null && isRawSubstitutor(containingClass, substitutorForMethod);
|
||||
if (!areFirstArgumentsApplicable(args, parms, languageLevel, substitutorForMethod, isRaw)) return ApplicabilityLevel.NOT_APPLICABLE;
|
||||
if (args.length == parms.length) {
|
||||
if (parms.length == 0) return ApplicabilityLevel.FIXED_ARITY;
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
class FooObject<T> {}
|
||||
class FooId<T extends FooObject> {}
|
||||
|
||||
interface Bar {
|
||||
<T extends FooObject, I extends FooId<? extends T>> T get(I key);
|
||||
<T extends FooObject, I extends FooId<? extends T>> Collection<T> get(Collection<I> keys);
|
||||
}
|
||||
|
||||
public class Target {
|
||||
void foo(Bar bar) {
|
||||
final Set<FooId<?>> keys = null;
|
||||
final Collection<FooObject> values = bar.get(keys);
|
||||
}
|
||||
}
|
||||
@@ -207,6 +207,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testIDEA103760(){ doTest5(false); }
|
||||
public void testIDEA105846(){ doTest5(false); }
|
||||
public void testIDEA105695(){ doTest5(false); }
|
||||
public void testIDEA104992(){ doTest5(false); }
|
||||
|
||||
public void testWildcardsOnRawTypes() { doTest5(false); }
|
||||
public void testDisableWithinBoundsCheckForSuperWildcards() {
|
||||
|
||||
Reference in New Issue
Block a user