Files
kotlin/compiler/testData/codegen/box/collections/inSetWithSmartCast.kt
2019-11-19 11:00:09 +03:00

18 lines
307 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
// KJS_WITH_FULL_RUNTIME
// WITH_RUNTIME
fun contains(set: Set<Any>, x: Int): Boolean = when {
set.size == 0 -> false
else -> x in set as Set<Int>
}
fun box(): String {
val set = setOf(1)
if (contains(set, 1)) {
return "OK"
}
return "Fail"
}