Files
kotlin-fork/compiler/testData/codegen/bytecodeText/javaFields.kt
T
Mikhail Glukhikh c0789b5207 PSI/FIR->IR translators: return to 1.7.10 behavior for field references
In 1.7.20 we used the nearest Java-based receiver for such field
references in backend. Now we are using use-site receiver again,
it can lead to accidental usage of derived class property backing field.

This is effectively a revert of KT-49507 fix, see commits:
- fa914f20
- b0a6508d

#KT-54393 Fixed
#KT-49507 Planned
#KT-52338 Planned
2022-10-25 08:36:01 +00:00

23 lines
345 B
Kotlin
Vendored

// FILE: Java1.java
public class Java1 {
public int f;
}
// FILE: Java2.java
public class Java2 extends Kotlin1 {
}
// FILE: test.kt
open class Kotlin1 : Java1()
open class Kotlin2 : Java2() {
fun getF() = super.f
}
fun test1(j: Kotlin2) = j.f
// @Kotlin2.class:
// 1 GETFIELD Java2.f : I
// @TestKt.class:
// 1 GETFIELD Kotlin2.f : I