mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
generics: do not accept inferred lower bound when inferred through raw type (IDEA-93672)
This commit is contained in:
+1
-1
@@ -273,8 +273,8 @@ public class PsiResolveHelperImpl implements PsiResolveHelper {
|
||||
}
|
||||
}
|
||||
|
||||
if (lowerBound != PsiType.NULL) return new Pair<PsiType, ConstraintType>(lowerBound, ConstraintType.EQUALS);
|
||||
if (rawInference != null) return rawInference;
|
||||
if (lowerBound != PsiType.NULL) return new Pair<PsiType, ConstraintType>(lowerBound, ConstraintType.EQUALS);
|
||||
|
||||
if (parent != null) {
|
||||
final Pair<PsiType, ConstraintType> constraint =
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
import java.util.*;
|
||||
|
||||
class Test {
|
||||
interface Condition<K> {}
|
||||
class IOC<M> implements Condition {}
|
||||
|
||||
static <T> List<T> filter(T[] c, Condition<? super T> con) {
|
||||
return null;
|
||||
}
|
||||
|
||||
interface OE {}
|
||||
interface LOE extends OE {}
|
||||
|
||||
void foo(OE[] es, IOC<LOE> con) {
|
||||
List<LOE> l = filter(es, con);
|
||||
}
|
||||
}
|
||||
@@ -183,6 +183,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testInconvertibleTypes() throws Exception { doTest(false); }
|
||||
public void testIncompatibleReturnType() throws Exception { doTest(false); }
|
||||
public void testContinueInferenceAfterFirstRawResult() throws Exception { doTest(false); }
|
||||
public void testDoNotAcceptLowerBoundIfRaw() throws Exception { doTest(false); }
|
||||
public void testStaticOverride() throws Exception { doTest(false); }
|
||||
public void testTypeArgumentsGivenOnRawType() throws Exception { doTest(false); }
|
||||
public void testTypeArgumentsGivenOnAnonymousClassCreation() throws Exception { doTest(false); }
|
||||
|
||||
Reference in New Issue
Block a user