Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/when/kt36818.fir.kt
T

12 lines
300 B
Kotlin
Vendored

fun main(x1: Double?, range: ClosedRange<Double>) {
when (x1) {
null -> throw Exception()
<!ARGUMENT_TYPE_MISMATCH!>in range<!> -> {} // error, no smartcast from previous branch, OK in OI
}
when {
x1 == null -> throw Exception()
x1 in range -> {}
}
}