mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 00:11:26 +07:00
recursive lambda checks for functional interfaces
This commit is contained in:
+1
-1
@@ -22,6 +22,6 @@ class CastInContexts {
|
||||
}
|
||||
|
||||
{
|
||||
int i = <error descr="Inconvertible types; cannot cast '<lambda expression>' to 'int'">(int) ()-> 1</error>;
|
||||
int i = (int) <error descr="int is not a functional interface">()-> 1</error>;
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class Demo {
|
||||
public static void main(String[] args) {
|
||||
Runnable r = () -> <error descr="void is not a functional interface">() -> () -> {}</error>;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -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="Incompatible return type <lambda expression> in lambda expression">(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);
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ class Test2 {
|
||||
}
|
||||
|
||||
{
|
||||
X<?> x = <error descr="No instance of type X<?> exists so that lambda expression can be type-checked">() -> 123</error>;
|
||||
X<?> x = () -> 123;
|
||||
X<? extends Number> x1 = () -> 123;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user