IR: get overridden directly from IrProperty when resolving fake override

The previous way of getting them either via getter or setter failed on
Java properties which only have a backing field. Now that IrProperty has
overriddenSymbols (after 53c1de172f), it makes sense to use it directly
instead. Use it only in SyntheticAccessorLowering though to avoid
breaking Kotlin/Native (see KT-47019).

 #KT-46900 Fixed
This commit is contained in:
Alexander Udalov
2021-05-27 17:35:36 +02:00
parent af35892007
commit 96f0b53761
8 changed files with 53 additions and 5 deletions
@@ -0,0 +1,20 @@
// TARGET_BACKEND: JVM
// FILE: Base.java
import org.jetbrains.annotations.NotNull;
public abstract class Base {
@NotNull
protected String result = "OK";
}
// FILE: Derived.kt
open class Mid : Base()
class Derived : Mid() {
fun foo(): String =
(Derived::result)(this)
}
fun box(): String = Derived().foo()