Files
kotlin-fork/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.fir.kt.txt
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

30 lines
538 B
Kotlin
Vendored

package test
fun <T : Any?> eval(f: Function0<T>): T {
return f.invoke()
}
class C : B {
constructor() /* primary */ {
super/*B*/()
/* <init>() */
}
fun f(): @FlexibleNullability String? {
return eval<@FlexibleNullability String?>(f = local fun <anonymous>(): @FlexibleNullability String? {
return <this>.#x
}
)
}
fun g(): @FlexibleNullability String? {
return eval<@FlexibleNullability String?>(f = local fun <anonymous>(): @FlexibleNullability String? {
return <this>.#y
}
)
}
}