mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
Existing code for receiver generation accidentally worked in most cases
for object members imported by name. However, it generated strange
bytecode (such as
GETFIELD AnObject.INSTANCE
GETFIELD AnObject.INSTANCE
POP
), and worked incorrectly for augmented assignments.
#KT-21343 Fixed Target versions 1.2.20
24 lines
321 B
Kotlin
Vendored
24 lines
321 B
Kotlin
Vendored
import Host.x
|
|
|
|
object A {
|
|
var xx = 0
|
|
}
|
|
|
|
object Host {
|
|
var A.x
|
|
get() = A.xx
|
|
set(v) { A.xx = v }
|
|
}
|
|
|
|
fun box(): String {
|
|
A.x += 1
|
|
if (A.x != 1) return "Fail 1: ${A.x}"
|
|
|
|
A.x++
|
|
if (A.x != 2) return "Fail 2: ${A.x}"
|
|
|
|
++A.x
|
|
if (A.x != 3) return "Fail 3: ${A.x}"
|
|
|
|
return "OK"
|
|
} |