Files
kotlin-fork/compiler/testData/codegen/box/jvmStatic/postfixInc.kt
T
Ilya Matveev a5e4e0284e Mute some box tests for native backend
This patch mutes the following test categories:
   * Tests with java dependencies (System class,
     java stdlib, jvm-oriented annotations etc).
   * Coroutines tests.
   * Reflection tests.
   * Tests with an inheritance from the standard
     collections.
2017-03-10 19:59:37 +03:00

51 lines
879 B
Kotlin
Vendored

// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
// WITH_RUNTIME
object A {
@JvmStatic var a: Int = 1
var b: Int = 1
@JvmStatic get
var c: Int = 1
@JvmStatic set
}
var holder = ""
fun getA(): A {
holder += "getA()"
return A
}
fun box(): String {
var p = A.a++
if (p != 1 || A.a != 2) return "fail 1"
p = A.b++
if (p != 1 || A.b != 2) return "fail 2"
p = A.c++
if (p != 1 || A.c != 2) return "fail 3"
p = getA().a++
if (p != 2 || A.a != 3 || holder != "getA()") return "fail 4: $holder"
holder = ""
p = getA().b++
if (p != 2 || A.b != 3 || holder != "getA()") return "fail 5: $holder"
holder = ""
p = getA().c++
if (p != 2 || A.c != 3 || holder != "getA()") return "fail 6: $holder"
holder = ""
return "OK"
}