IDEA-84377: check for recursive bounds

This commit is contained in:
anna
2012-05-02 12:07:12 +02:00
parent 4e1ceb5587
commit e8b5fad3f6
2 changed files with 34 additions and 1 deletions
@@ -1,4 +1,5 @@
import java.util.*;
import java.util.Comparator;
/**
@@ -247,3 +248,22 @@ class IDEA79360 {
map = new HashMap<Object, Object>(test);
}
}
class GenericFailureExample {
interface Descriptor<T extends Comparable<T>> {
Class<T> getType();
}
void isMarkedFaultyButCompilesClean(Descriptor<?> n) {
bar(n.getType());
}
<T extends Comparable<T>> void butThisWorks(Descriptor<T> n) {
bar(n.getType());
}
<T extends Comparable<T>> Comparator<T> bar(Class<T> type) {
return null;
}
}