Files
kotlin-fork/backend.native/tests/codegen/object/fields.kt
T
2016-12-27 13:56:03 +03:00

16 lines
339 B
Kotlin

private var globalValue = 1
var global:Int
get() = globalValue
set(value:Int) {globalValue = value}
fun globalTest(i:Int):Int {
global += i
return global
}
fun main(args:Array<String>) {
if (global != 1) throw Error()
if (globalTest(41) != 42) throw Error()
if (global != 42) throw Error()
}