Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/when/kt36818.fir.kt
T
2021-11-26 11:26:21 +03:00

12 lines
298 B
Kotlin
Vendored

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