Files
kotlin-fork/compiler/testData/codegen/boxInline/property/fromObject.kt
T
Mikhael Bogdanov cf6f823d29 Use descriptor from resolved call to inline accessors
In case of inline it should be same descriptor (except of fake override), In general case getter could be synthetic accessor and in such case it's not inline
2019-11-29 13:15:42 +01:00

28 lines
443 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
// FILE: 1.kt
// WITH_RUNTIME
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
}