Files
kotlin-fork/backend.native/tests/codegen/object/fields.kt
T
2017-10-20 18:25:05 +03:00

20 lines
385 B
Kotlin

package codegen.`object`.fields
import kotlin.test.*
private var globalValue = 1
var global:Int
get() = globalValue
set(value:Int) {globalValue = value}
fun globalTest(i:Int):Int {
global += i
return global
}
@Test fun runTest() {
if (global != 1) throw Error()
if (globalTest(41) != 42) throw Error()
if (global != 42) throw Error()
}