mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-25 14:25:04 +07:00
cast conversion applicable for wildcard vs type parameter if bounds agree (IDEA-75628)
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
abstract class Test {
|
||||
interface Selection<A> {}
|
||||
interface CriteriaQuery<T> {
|
||||
void select(Selection<? extends T> selection);
|
||||
}
|
||||
|
||||
private <N> void foo(CriteriaQuery<N> criteria, Selection<String[]> array) {
|
||||
criteria.select((Selection<? extends N>)array);
|
||||
}
|
||||
|
||||
private <N extends Integer> void foo1(CriteriaQuery<N> criteria, Selection<String[]> array) {
|
||||
criteria.select(<error descr="Inconvertible types; cannot cast 'Test.Selection<java.lang.String[]>' to 'Test.Selection<? extends N>'">(Selection<? extends N>)array</error>);
|
||||
}
|
||||
|
||||
private <N extends Integer> void foo2(CriteriaQuery<N> criteria, Selection<Object> array) {
|
||||
criteria.select(<error descr="Inconvertible types; cannot cast 'Test.Selection<java.lang.Object>' to 'Test.Selection<? extends N>'">(Selection<? extends N>)array</error>);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user