lambda return type inconsistency: highlight all found errors (IDEA-158853)

This commit is contained in:
Anna.Kozlova
2016-07-21 19:03:45 +02:00
parent 5ebf15c6ca
commit 035b6d9d1f
4 changed files with 52 additions and 17 deletions
@@ -0,0 +1,15 @@
import java.util.function.Supplier;
class Test {
public static void bar(boolean f) {
foo(() -> {
if (f) <error descr="Missing return value">return;</error>
if (false) <error descr="Missing return value">return;</error>
if (!f) return <error descr="Bad return type in lambda expression: int cannot be converted to String">1</error>;
return null;
});
}
public static void foo(Supplier<String> consumer) {}
}