IR: Process script with LDL as if it is a function body
#KT-46645 fixed #KT-48025 fixed
This commit is contained in:
committed by
TeamCityServer
parent
ebcc6eec97
commit
e7cbc9a0fb
@@ -0,0 +1,31 @@
|
||||
// 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
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
|
||||
val p = 0
|
||||
|
||||
class ReducedFraction() {
|
||||
fun plus1() = reducedFractionOf(p)
|
||||
val y = 1
|
||||
}
|
||||
|
||||
fun reducedFractionOf(a: Int) {
|
||||
}
|
||||
|
||||
val c = ReducedFraction()
|
||||
val x = c.y
|
||||
// expected: x: 1
|
||||
Reference in New Issue
Block a user