Files
kotlin-fork/compiler/testData/codegen/box/increment/postfixIncrementOnSmartCast.kt
T
2019-11-19 11:00:09 +03:00

11 lines
293 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
public fun box() : String {
var i : Int?
i = 10
// Postfix increment on a smart cast should work
// Specific: i.inc() type is Int but i and j types are both Int?
val j = i++
return if (j == 10 && 11 == i) "OK" else "fail j = $j i = $i"
}