Files
kotlin-fork/compiler/testData/codegen/box/script/localCaptureTests.kt
T
Ilya Chernikov e7cbc9a0fb IR: Process script with LDL as if it is a function body
#KT-46645 fixed
#KT-48025 fixed
2021-08-23 12:49:43 +03:00

31 lines
513 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_LIGHT_ANALYSIS
// WITH_RUNTIME
// FILE: test.kt
fun box(): String =
Script.Build.Debug.run { "${c0()}${c1()}" }
// FILE: script.kts
interface Base {
val v: String
fun c0(): Char {
fun getC0() = v[0]
return getC0()
}
}
enum class Build(override val v: String): Base {
Debug("OK"),
Release("NO");
fun c1(): Char {
val g = object {
val c1 = v[1]
}
return g.c1
}
}