new inference: include lifting constraint when parent call is being investigated

(cherry picked from commit aaeafcdce1c8d49512cc1fece17afb3e1705492e)
This commit is contained in:
anna
2013-11-25 16:48:11 +01:00
parent 45cf19cae3
commit fc58e5e0af
3 changed files with 31 additions and 9 deletions
@@ -0,0 +1,15 @@
class Test {
static class SuperFoo<X> {}
static class Foo<X extends Number> extends SuperFoo<X> {}
interface I<Y> {
SuperFoo<Y> m();
}
<R> SuperFoo<R> foo(I<R> ax) { return null; }
SuperFoo<String> ls = foo(() -> new Foo<<error descr="Type parameter 'java.lang.String' is not within its bound; should extend 'java.lang.Number'"></error>>());
SuperFoo<Integer> li = foo(() -> new Foo<>());
SuperFoo<?> lw = foo(() -> new Foo<>());
}