c0789b5207
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
18 lines
429 B
Kotlin
Vendored
18 lines
429 B
Kotlin
Vendored
// TARGET_BACKEND: JVM_IR
|
|
// IGNORE_BACKEND: JVM_IR
|
|
// IGNORE_BACKEND_FIR: JVM_IR
|
|
// FIR_STATUS: accesses property backing field accidentally and fails with exception (does not work in K1/JVM too)
|
|
// Field VS property: case 4.1
|
|
// See KT-54393 for details
|
|
|
|
// FILE: BaseJava.java
|
|
public class BaseJava {
|
|
public String a = "OK";
|
|
}
|
|
|
|
// FILE: Derived.kt
|
|
class Derived : BaseJava() {
|
|
val a = "FAIL"
|
|
}
|
|
|
|
fun box() = Derived().a |