Files
kotlin-fork/compiler/testData/diagnostics/tests/when/NonExhaustiveWithNullabilityCheck.fir.kt
T

12 lines
257 B
Kotlin
Vendored

// KT-7857: when exhaustiveness does not take previous nullability checks into account
enum class X { A, B }
fun foo(arg: X?): Int {
if (arg != null) {
return when (arg) {
X.B -> 2
}
}
else {
return 0
}
}