don't open capture if reference expression is returned from lambda expression (IDEA-139089)

This commit is contained in:
Anna Kozlova
2015-05-12 21:42:53 +02:00
parent 2512a27225
commit 4a63204f8b
4 changed files with 27 additions and 0 deletions
@@ -0,0 +1,14 @@
import java.util.function.Function;
interface I<T>{
void foo(Function<T, T> f);
}
class C {
void bar(I<?> x) {
x.foo(a -> {
x.foo(y -> <error descr="Bad return type in lambda expression: capture of ? cannot be converted to capture of ?">a</error>);
return a;
});
}
}