eab5164993
The problem was that in K2 for some top-level script declarations we need to add a dispatch receiver parameter (because frontend do not assign any, but representing script as a class requires it to be the script class) and at the same time, calls to these declarations rely on properly set dispatch receiver parameter. The simplest solution found is to have an additional traversal on the relevan top-level declarations and assigning the dispatch receiver, before running the main transformation. #KT-64502 fixed
16 lines
237 B
Kotlin
Vendored
16 lines
237 B
Kotlin
Vendored
// JVM_ABI_K1_K2_DIFF: KT-63960, KT-63963, KT-63964
|
|
|
|
val p = 0
|
|
|
|
class ReducedFraction() {
|
|
fun plus1() = reducedFractionOf(p)
|
|
val y = 1
|
|
}
|
|
|
|
fun reducedFractionOf(a: Int) {
|
|
}
|
|
|
|
val c = ReducedFraction()
|
|
val x = c.y
|
|
// expected: x: 1
|