mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
ensure bounds are promoted on derived type otherwise bounds from super could appear on unbounded wildcards (IDEA-162882)
This commit is contained in:
+23
@@ -0,0 +1,23 @@
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
interface NumberCollection<N extends Number> extends Collection<N> {
|
||||
}
|
||||
|
||||
interface IntegerCollection<I extends Integer> extends NumberCollection<I> {}
|
||||
interface IntegerCollection1<I extends Integer, L extends I> extends NumberCollection<L> {}
|
||||
|
||||
class Test {
|
||||
<T extends Number, C extends NumberCollection<? extends T>> Collection<T> filter(Collection<C> input) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void foo(Collection<IntegerCollection<?>> input) {
|
||||
Collection<Integer> filtered = filter(input);
|
||||
}
|
||||
|
||||
public void foo1(Collection<IntegerCollection1<?, ?>> input) {
|
||||
Collection<Integer> filtered = filter(input);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user