f32367d2c2
The previous one was incorrect for K1 since parent of top-level function is `IrClass`, not `IrPackageFragment`. The change is non-functional, K1 still worked correctly, but had to do some extra work when inlining `emptyArray` calls and produces less performant bytecode.
29 lines
445 B
Kotlin
Vendored
29 lines
445 B
Kotlin
Vendored
// WITH_STDLIB
|
|
// JVM_ABI_K1_K2_DIFF: KT-66000
|
|
|
|
// FILE: 1.kt
|
|
package test
|
|
|
|
open class A(var result: String) {
|
|
|
|
var y
|
|
inline get() = if (this is C) this else A(result)
|
|
inline set(a: A) {
|
|
if (this is C) this else A(a.result.also { this.result = it })
|
|
}
|
|
}
|
|
|
|
object C : A("failA")
|
|
|
|
object B : A("failB")
|
|
|
|
// FILE: 2.kt
|
|
import test.A
|
|
import test.B.y
|
|
|
|
fun box(): String {
|
|
y = A("OK")
|
|
|
|
return y.result
|
|
}
|