lambda: accept Object when return type is void

This commit is contained in:
Anna Kozlova
2012-08-20 15:11:16 +04:00
parent a060e747ab
commit 05c0cfbb5e
2 changed files with 17 additions and 3 deletions

View File

@@ -1,3 +1,4 @@
import java.lang.String;
import java.util.*;
class Test4 {
interface I<K> {
@@ -33,4 +34,16 @@ class Test6 {
bar(<error descr="Incompatible return type <null> in lambda expression">() -> null</error>);
bar(() -> {});
}
}
class Test7 {
interface I<K> {
void foo(String s);
}
static <T> void bar(I<T> i){}
{
bar(x -> {});
}
}