invocation type inference: when unchecked conversion was performed - treat its results in return value checks as they were in bounds

This commit is contained in:
Anna Kozlova
2014-01-31 22:16:02 +04:00
parent be84252e83
commit 89d2ebc500
3 changed files with 19 additions and 1 deletions
@@ -0,0 +1,14 @@
public class Sample {
interface G<A> {}
interface G1 extends G {}
void foo(G1 g1) {
bar(g1);
}
<B> B bar(G<B> gb) {return null;}
void f(G1 g1) {
<error descr="Incompatible types. Found: 'java.lang.Object', required: 'Sample.G<java.lang.String>'">G<String> l11 = bar(g1);</error>
<error descr="Incompatible types. Found: 'java.lang.Object', required: 'java.lang.String'">String l1 = bar(g1);</error>
Object o = bar(g1);
}
}