JVM_IR: cast bound property receivers to original type

Because the receiver type is used for determining where to put
accessors, and the type of fake overrides' receivers is the same as for
the original declaration, casting to the type of the parameter leads to
assertion errors.

 #KT-44658 Fixed
This commit is contained in:
pyos
2021-03-17 13:23:39 +01:00
committed by Alexander Udalov
parent 1d96f810da
commit 85aa6383ad
11 changed files with 80 additions and 9 deletions
@@ -0,0 +1,21 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: WASM
// FILE: 1.kt
package a
open class A {
protected val v = "O"
protected var w = ""
}
// FILE: 2.kt
import a.*
class B : A() {
fun foo(): String {
B::w.set(this, "K")
return ::v.get() + B::w.get(this)
}
}
fun box() = B().foo()