Files
kotlin-fork/compiler/testData/codegen/boxInline/property/simpleExtension.kt
T
Svyatoslav Kuzmich e1f72d60dc [Wasm] stdlib API: Mark primitives constructor properties as private
These are implementation detail and were not meant to be public
2023-01-24 14:55:00 +01:00

26 lines
376 B
Kotlin
Vendored

// FILE: 1.kt
package test
var value: Int = 0
inline var Int.z: Int
get() = this + ++value
set(p: Int) { value = p + this}
// FILE: 2.kt
import test.*
fun box(): String {
val v = 11.z
if (v != 12) return "fail 1: $v"
11.z = v + 2
if (value != 25) return "fail 2: $value"
var p = 11.z
if (p != 37) return "fail 3: $p"
return "OK"
}