lambda: initial is assignable check; effectively final; acceptable context

This commit is contained in:
anna
2012-07-19 21:18:30 +02:00
parent 714b565acd
commit 812b9a72ea
15 changed files with 303 additions and 24 deletions
@@ -11,8 +11,9 @@ class Foo {
};
void bazz() {
bar((String s) -> {
System.out.println(s);});
bar<error descr="'bar(I)' in 'Foo' cannot be applied to '(<lambda expression>)'">((String s) -> {
System.out.println(s);})</error>;
bar((int i) -> {System.out.println(i);});
}
void bar(I i){}
}
@@ -0,0 +1,7 @@
class XXX {
Runnable bar() {
<error descr="Incompatible types. Found: '<lambda expression>', required: 'java.lang.Runnable'">return (o)->{
System.out.println();
};</error>
}
}