Files
kotlin-fork/compiler/testData/codegen/box/sam/constructors/runnableAccessingClosure2.kt
T
2018-06-28 12:26:41 +02:00

14 lines
282 B
Kotlin
Vendored

// IGNORE_BACKEND: 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()
}