KT-6159: generate Unit while code inlining when needed
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user