Files
kotlin/compiler/testData/codegen/box/objects/objectLiteralInClass.kt
Georgy Bronnikov 094de9fb5e IR: Do not capture variables from method calls in ClosureAnnotator
To call a method of a class, you never need to supply any values of
local variables (they would always be provided to the constructor).
2019-12-10 17:31:12 +03:00

18 lines
251 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
class C {
val s = "OK"
private val localObject = object {
fun getS(): String {
return s
}
}
fun ok(): String =
33.let { localObject.getS() }
}
fun box() = C().ok()