mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-07 13:39:36 +07:00
lambda: relax incompatible return type in case of void functional types
This commit is contained in:
@@ -7,7 +7,7 @@ class Test1 {
|
||||
VoidReturnType aI = () -> System.out.println();
|
||||
VoidReturnType aI1 = () -> {System.out.println();};
|
||||
VoidReturnType aI2 = <error descr="Unexpected return value">() -> {return 1;}</error>;
|
||||
VoidReturnType aI3 = <error descr="Incompatible return type int in lambda expression">() -> 1</error>;
|
||||
VoidReturnType aI3 = () -> 1;
|
||||
VoidReturnType aI4 = () -> {return;};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ class Test5 {
|
||||
static <T> void bar(I<T> i){}
|
||||
|
||||
{
|
||||
bar(<error descr="Incompatible return type <null> in lambda expression">() -> null</error>);
|
||||
bar(<error descr="Incompatible parameter types in lambda expression">() -> null</error>);
|
||||
}
|
||||
}
|
||||
class Test6 {
|
||||
@@ -31,7 +31,7 @@ class Test6 {
|
||||
static <T> void bar(I<T> i){}
|
||||
|
||||
{
|
||||
bar(<error descr="Incompatible return type <null> in lambda expression">() -> null</error>);
|
||||
bar(() -> null);
|
||||
bar(() -> {});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user