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:
+21
@@ -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()
|
||||
Reference in New Issue
Block a user