mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
temp revert capture open
This commit is contained in:
@@ -158,10 +158,16 @@ public class PsiSubstitutorImpl implements PsiSubstitutor {
|
||||
}
|
||||
if (newBound instanceof PsiCapturedWildcardType) {
|
||||
final PsiWildcardType wildcard = ((PsiCapturedWildcardType)newBound).getWildcard();
|
||||
if (wildcardType.isExtends() != wildcard.isExtends() && wildcard.isBounded()) {
|
||||
return wildcardType.isExtends() ? PsiWildcardType.createExtends(wildcardType.getManager(), newBound)
|
||||
: PsiWildcardType.createSuper(wildcardType.getManager(), newBound);
|
||||
if (wildcardType.isExtends() != wildcard.isExtends()) {
|
||||
if (wildcard.isBounded()) {
|
||||
return wildcardType.isExtends() ? PsiWildcardType.createExtends(wildcardType.getManager(), newBound)
|
||||
: PsiWildcardType.createSuper(wildcardType.getManager(), newBound);
|
||||
}
|
||||
else {
|
||||
return newBound;
|
||||
}
|
||||
}
|
||||
if (!wildcard.isBounded()) return PsiWildcardType.createUnbounded(wildcardType.getManager());
|
||||
return newBound;
|
||||
}
|
||||
|
||||
|
||||
+15
-1
@@ -1,6 +1,19 @@
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
class Test {
|
||||
public static final Comparator<Object> ORDER_AWARE_COMPARATOR = null;
|
||||
|
||||
public static void orderAwareSort(List<?> data) {
|
||||
sort(data, ORDER_AWARE_COMPARATOR);
|
||||
}
|
||||
|
||||
public static <T> void sort(List<T> list, Comparator<? super T> c) {}
|
||||
}
|
||||
|
||||
class FooBar<T> {
|
||||
void foo(final FooBar<?> fooBar){
|
||||
fooBar.supertype<error descr="'supertype(java.lang.Class<capture<?>>)' in 'FooBar' cannot be applied to '(java.lang.Class<java.lang.Iterable>)'">(Iterable.class)</error>;
|
||||
//fooBar.supertype(Iterable.class);
|
||||
}
|
||||
|
||||
void foo1(final FooBar<? super T> fooBar){
|
||||
@@ -13,3 +26,4 @@ class FooBar<T> {
|
||||
|
||||
void supertype(Class<? super T> superclass) {}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user