4f834cb16b
Otherwise, it's complicated to work with nested lambdas: outer/inner ones may be replaced independently and still refer to the old one instances. So in the changed test, if we don't apply the commit, will remain implicit return and receiver types for the nested lambda Anyway, once we decided to leave immutable semantics, replacements are not necessary anymore
10 lines
156 B
Kotlin
Vendored
10 lines
156 B
Kotlin
Vendored
fun <T> block(block: () -> T): T = block()
|
|
fun foo() {}
|
|
|
|
fun test(): () -> Unit = block { fun() = foo() }
|
|
|
|
fun box(): String {
|
|
test()
|
|
return "OK"
|
|
}
|