temp revert capture open

This commit is contained in:
Anna Kozlova
2014-06-23 20:10:00 +02:00
parent b5240b4e46
commit 69e6a15e27
2 changed files with 24 additions and 4 deletions
@@ -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;
}
@@ -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) {}
}