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
This commit is contained in:
Mikhael Bogdanov
2019-11-25 08:38:38 +01:00
parent 320c5f6f00
commit cf6f823d29
10 changed files with 69 additions and 13 deletions
-1
View File
@@ -1,6 +1,5 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM
// JVM_TARGET: 1.8
open class A(val x: String) {
@@ -0,0 +1,27 @@
// 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
}