allow functional interfaces in conditionals inside assignment or invocation contexts only

This commit is contained in:
Anna.Kozlova
2016-10-04 18:45:14 +02:00
parent 55722aff31
commit 3332a677a6
2 changed files with 22 additions and 8 deletions
@@ -23,6 +23,8 @@ interface II {
class Test1 {
void bar(boolean b){
II ik = b ? (s)-> true : (s)->false;
II ik1 = (II)(b ? <error descr="Lambda expression not expected here">(s)-> true</error> : <error descr="Lambda expression not expected here">(s)->false</error>);
II ik1 = (II)((b ? <error descr="Lambda expression not expected here">(s)-> true</error> : <error descr="Lambda expression not expected here">(s)->false</error>));
II ik2 = (II)(ik1 = (b ? (s)-> true : (s)->false));
(b ? <error descr="Lambda expression not expected here">(s) -> true</error> : ik)._("");
}
}