mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-07 05:09:37 +07:00
pertinent to applicability: process return statements inside block lambda
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
class Test {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
Runnable iteration = compute(() -> {
|
||||
if (true) return () -> {};
|
||||
return null;
|
||||
});
|
||||
Runnable iteration2 = compute(() -> () -> {});
|
||||
}
|
||||
|
||||
static <T> T compute(Callable<T> c) throws Exception {
|
||||
return c.call();
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ class NoInferenceResult {
|
||||
|
||||
void test() {
|
||||
m((String s1) -> <error descr="Target type of a lambda conversion must be an interface">(String s2) -> s1 + s2</error>);
|
||||
m(<error descr="B is not a functional interface">(String s1) -> {return (String s2) -> s1 + s2;}</error>);
|
||||
m((String s1) -> {return <error descr="Target type of a lambda conversion must be an interface">(String s2) -> s1 + s2</error>;});
|
||||
|
||||
m((String s1) -> s1.length());
|
||||
m((String s1) -> s1);
|
||||
|
||||
Reference in New Issue
Block a user