new inference: erasure of type parameters with proper bounds (IDEA-162544)

This commit is contained in:
Anna.Kozlova
2016-10-19 19:17:33 +02:00
parent 01b1f7cd6a
commit f26364eca1
2 changed files with 21 additions and 1 deletions
@@ -8,6 +8,12 @@ abstract class Group {
}
public abstract <R extends Category<R>> R getCategory(Key<R> key);
public <T extends Category> T get1(Key<T> key) {
return getCategory1(key);
}
public abstract <R extends Category> R getCategory1(Key<R> key);
}
interface Category<Tc extends Category> {
@@ -15,3 +21,17 @@ interface Category<Tc extends Category> {
class Key<Tk extends Category> {
}
class Test {
static <T extends B> T get(T b) {
return create(b);
}
public static <K extends A<?, ?>> K create(K a) {
return a;
}
}
class A<T, U> {}
class B<R> extends A<Object, R> {}