KT-6159: generate Unit while code inlining when needed

This commit is contained in:
Mikhail Glukhikh
2017-03-23 18:57:19 +03:00
parent 7de0197a60
commit b6803af746
4 changed files with 12 additions and 8 deletions
@@ -2,9 +2,9 @@ fun <T> doIt(p: () -> T): T = TODO()
fun g(p: String?) {
p?.let { }
p?.let { Unit }
}
fun h() = Unit
fun x() = doIt { }
fun x() = doIt { Unit }
@@ -9,6 +9,7 @@ class C {
p?.let {
println(3)
println(4)
Unit
}
if (other != null) {
@@ -25,5 +26,6 @@ class C {
fun x() = doIt {
println(9)
println(10)
Unit
}
}
@@ -9,6 +9,7 @@ fun g(p: String?) {
p?.let {
println(3)
nonUnit(4)
Unit
}
}
@@ -20,5 +21,5 @@ fun h() {
fun x() = doIt {
println(7)
nonUnit(8)
// Unit should be here
Unit
}