mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
new inference: erasure of type parameters with proper bounds (IDEA-162544)
This commit is contained in:
+20
@@ -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> {}
|
||||
Reference in New Issue
Block a user