Files
kotlin-fork/compiler/testData/diagnostics/tests/when/nonExhaustiveDependentContext.kt
T
Denis.Zharkov 04d3996e68 K2: Resolve non-exhaustive when expressions independently
^KT-55169 Fixed
^KT-55175 Related
2023-02-15 08:13:43 +00:00

14 lines
272 B
Kotlin
Vendored

// SKIP_TXT
fun bar(a: String): String {
return when {
a.length == 1 -> {
<!NO_ELSE_IN_WHEN!>when<!> { // Error in K1, no error in K2
a == "a" -> ""
a == "b" -> ""
}
}
else -> ""
}
}