bad return type in lambda expression: requited type added; range corrected (IDEA-134942)

This commit is contained in:
Anna Kozlova
2015-01-07 16:07:27 +01:00
parent c11d64ac60
commit 8ce9831489
12 changed files with 33 additions and 30 deletions
@@ -9,7 +9,7 @@ class Test {
<R> SuperFoo<R> foo(I<R> ax) { return null; }
SuperFoo<String> ls = foo(<error descr="Incompatible return type Foo<X> in lambda expression">() -> new Foo<>()</error>);
SuperFoo<String> ls = foo(() -> <error descr="Bad return type in lambda expression: Foo<X> cannot be converted to SuperFoo<R>">new Foo<>()</error>);
SuperFoo<Integer> li = foo(() -> new Foo<>());
SuperFoo<?> lw = foo(() -> new Foo<>());
}
@@ -13,7 +13,7 @@ class Test {
}
void bar(C c) {
foo(c, <error descr="Incompatible return type A in lambda expression">x -> x.f()</error>);
foo(c, x -> <error descr="Bad return type in lambda expression: A cannot be converted to C">x.f()</error>);
foo(c, x -> x);
}