Files
kotlin-fork/compiler/testData/codegen/box/operatorConventions/kt4987.kt
T
2016-11-09 21:41:12 +03:00

9 lines
262 B
Kotlin
Vendored

// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
fun box(): String {
operator fun Int?.inc() = (this ?: 0) + 1
var counter: Int? = null
counter++
return if (counter == 1) "OK" else "fail: $counter"
}