mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
check whether wildcard bound or not (IDEA-57343)
This commit is contained in:
@@ -502,7 +502,7 @@ public class PsiResolveHelperImpl implements PsiResolveHelper {
|
||||
if (paramBound == null) return null;
|
||||
ConstraintType constrType = wildcardParam.isExtends() ? ConstraintType.SUPERTYPE : ConstraintType.SUBTYPE;
|
||||
if (arg instanceof PsiWildcardType) {
|
||||
if (((PsiWildcardType)arg).isExtends() == wildcardParam.isExtends()) {
|
||||
if (((PsiWildcardType)arg).isExtends() == wildcardParam.isExtends() && ((PsiWildcardType)arg).isBounded() == wildcardParam.isBounded()) {
|
||||
Pair<PsiType, ConstraintType> res = getSubstitutionForTypeParameterInner(paramBound, ((PsiWildcardType)arg).getBound(),
|
||||
patternType, constrType, depth);
|
||||
if (res != null) return res;
|
||||
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
class D<T> {
|
||||
void foo(D<?> x){
|
||||
bar<error descr="'bar(D<? extends java.lang.Object>, D<? super java.lang.Object>)' in 'D' cannot be applied to '(D<capture<?>>, D<capture<?>>)'">(x,x)</error>;
|
||||
}
|
||||
<T> void bar(D<? extends T> x, D<? super T> y){}
|
||||
}
|
||||
@@ -85,6 +85,8 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testIDEADEV23157() throws Exception { doTest(true); }
|
||||
public void testIDEADEV24166() throws Exception { doTest(true); }
|
||||
public void testIDEADEV25778() throws Exception { doTest(true); }
|
||||
public void testIDEADEV57343() throws Exception { doTest(false); }
|
||||
|
||||
public void testGenericExtendException() throws Exception { doTest(false); }
|
||||
public void testSameErasureDifferentReturnTypes() throws Exception { doTest(false); }
|
||||
public void testDeepConflictingReturnTypes() throws Exception { doTest(false); }
|
||||
|
||||
Reference in New Issue
Block a user