Files
kotlin-fork/compiler/testData/codegen/box/script/localCaptureTests.kt
T
Ilya Chernikov 78ca733c38 FIR JS: add K2 variants of all other JS tests
except tests that are not possible to add without some modifications in
the test infra. See todos on the commented-out test declarations
2022-11-12 16:28:24 +01:00

32 lines
562 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// IGNORE_BACKEND_K2: JVM_IR, JS_IR
// FIR status: scripts aren't supported yet
// IGNORE_LIGHT_ANALYSIS
// WITH_STDLIB
// 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
}
}