Files
kotlin-fork/compiler/testData/codegen/box/sam/constructors/runnableAccessingClosure2.kt
T
2019-11-19 11:00:09 +03:00

14 lines
286 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
class Box(val s: String) {
fun extract(): String {
var result = ""
Runnable { result = s }.run() // capturing this and local var
return result
}
}
fun box(): String {
return Box("OK").extract()
}