K2 JVM IR: fix access to Java field shadowed by Kotlin property

#KT-56386 Fixed

Co-authored-by: Mikhail Glukhikh <Mikhail.Glukhikh@jetbrains.com>
This commit is contained in:
Alexander Udalov
2023-02-09 00:57:53 +01:00
parent 641d636c45
commit d73d3c46e2
28 changed files with 363 additions and 97 deletions
@@ -0,0 +1,37 @@
// TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_K1: JVM_IR
// CHECK_BYTECODE_TEXT
// FILE: a/VeryBase.java
package a;
class VeryBase {
public String foo = "OK";
}
// FILE: a/Base.java
package a;
public class Base extends VeryBase {
}
// FILE: b/Intermediate.java
package b;
class Intermediate extends a.Base {
}
// FILE: box.kt
package b
private class Final : Intermediate() {
private val foo = "FAIL"
}
fun box(): String =
Final().foo
// 1 GETFIELD b/Intermediate.foo