Files
kotlin-fork/compiler/testData/codegen/box/functions/functionExpression/insideGenericLambda.kt
T
Denis Zharkov 4f834cb16b FIR: Get rid of replacements map during calls completion
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
2020-02-04 16:24:01 +03:00

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"
}