Files
kotlin-fork/compiler/testData/codegen/box/sam/constructors/runnableAccessingClosure2.kt
T
2020-05-25 21:24:39 +03:00

13 lines
256 B
Kotlin
Vendored

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