type compatibility constrain: unchecked conversion step

This commit is contained in:
Anna Kozlova
2014-01-31 21:41:15 +04:00
parent af8095f8b0
commit 5a9c00a259
5 changed files with 45 additions and 10 deletions
@@ -10,7 +10,7 @@ class Test {
public void test(Set<MyConsumer> set) {
@SuppressWarnings("unchecked")
Map<Parent, MyConsumer<Parent>> map = <error descr="Inferred type 'T' for type parameter 'T' is not within its bound; should implement 'Test.Consumer<Test.Parent>'">create(set)</error>;
Map<Parent, MyConsumer<Parent>> map = create<error descr="'create(java.util.Set<T>)' in 'Test' cannot be applied to '(java.util.Set<Test.MyConsumer>)'">(set)</error>;
}
@@ -0,0 +1,14 @@
public class Sample {
interface G<A> {}
interface G1 extends G {}
void foo(G1 g1) {
bar(g1);
}
<B>void bar(G<B> gb) {}
void foo(G1[] g1) {
bar(g1);
}
<B>void bar(G<B>[] gb) {}
}