Pseudocode: Do not generate implicit return instruction inside of

Unit-typed lambdas
 #KT-5549 Fixed
This commit is contained in:
Alexey Sedunov
2014-07-29 20:53:23 +04:00
parent 17dd5b9d05
commit 9fee8600cb
17 changed files with 63 additions and 33 deletions
@@ -13,4 +13,4 @@ fun test() {
foo({if (1==1);}())
return if (true);
}
}
@@ -48,13 +48,13 @@ fun test2(): Unit { while(true) {} }
fun testCoercionToUnit() {
val <!UNUSED_VARIABLE!>simple<!>: ()-> Unit = {
41
<!UNUSED_EXPRESSION!>41<!>
}
val <!UNUSED_VARIABLE!>withIf<!>: ()-> Unit = {
if (true) {
3
<!UNUSED_EXPRESSION!>3<!>
} else {
45
<!UNUSED_EXPRESSION!>45<!>
}
}
val i = 34
@@ -66,8 +66,8 @@ fun testCoercionToUnit() {
doSmth(d)
}
2 -> '4'
else -> true
2 -> <!UNUSED_EXPRESSION!>'4'<!>
else -> <!UNUSED_EXPRESSION!>true<!>
}
}