Files
kotlin-fork/compiler/testData/codegen/box/javaFieldAndKotlinProperty/javaPackagePrivateClassAndPublicField.kt
T
Alexander Udalov d73d3c46e2 K2 JVM IR: fix access to Java field shadowed by Kotlin property
#KT-56386 Fixed

Co-authored-by: Mikhail Glukhikh <Mikhail.Glukhikh@jetbrains.com>
2023-02-23 12:54:00 +01:00

38 lines
490 B
Kotlin
Vendored

// 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