lambda: restore void-compatibility checks

This commit is contained in:
anna
2013-02-20 20:41:05 +01:00
parent f284e22971
commit def5e21e6a
3 changed files with 5 additions and 5 deletions
@@ -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 = () -> 1;
VoidReturnType aI3 = <error descr="Incompatible return type int in lambda expression">() -> 1</error>;
VoidReturnType aI4 = () -> {return;};
}
}
@@ -20,7 +20,7 @@ class Test5 {
static <T> void bar(I<T> i){}
{
bar(<error descr="Incompatible parameter types in lambda expression">() -> null</error>);
bar(<error descr="Incompatible return type <null> in lambda expression">() -> null</error>);
}
}
class Test6 {
@@ -31,7 +31,7 @@ class Test6 {
static <T> void bar(I<T> i){}
{
bar(() -> null);
bar(<error descr="Incompatible return type <null> in lambda expression">() -> null</error>);
bar(() -> {});
}
}