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

15 lines
287 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
val x: Int? = 42
val n: Int? = null
fun box(): String {
if (x in 0..2) return "Fail in"
if (!(x !in 0..2)) return "Fail !in"
if (n in 0..2) return "Fail in null"
if (!(n !in 0..2)) return "Fail !in null"
return "OK"
}