mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
captured wildcards: check upper bound first
This commit is contained in:
@@ -749,13 +749,14 @@ public class TypeConversionUtil {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (left instanceof PsiCapturedWildcardType) {
|
||||
return left.equals(right) || isAssignable(((PsiCapturedWildcardType)left).getLowerBound(), right, allowUncheckedConversion);
|
||||
}
|
||||
if (right instanceof PsiCapturedWildcardType) {
|
||||
return isAssignable(left, ((PsiCapturedWildcardType)right).getUpperBound(), allowUncheckedConversion);
|
||||
}
|
||||
|
||||
if (left instanceof PsiCapturedWildcardType) {
|
||||
return left.equals(right) || isAssignable(((PsiCapturedWildcardType)left).getLowerBound(), right, allowUncheckedConversion);
|
||||
}
|
||||
|
||||
if (left instanceof PsiWildcardType) {
|
||||
return isAssignableToWildcard((PsiWildcardType)left, right);
|
||||
}
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ abstract class A<T> {
|
||||
<K> void baz37(B<K, ? extends K> a) {}
|
||||
abstract B<T,? extends T> foo37();
|
||||
void bar37(A<?> a){
|
||||
baz37<error descr="'baz37(B<K,? extends K>)' in 'A' cannot be applied to '(B<capture<?>,capture<? extends capture<?>>>)'">(a.foo37())</error>;
|
||||
baz37(a.foo37());
|
||||
}
|
||||
|
||||
<K> void baz39(B<K, ? extends K> a) {}
|
||||
|
||||
Reference in New Issue
Block a user