Files
kotlin-fork/compiler/testData/diagnostics/tests/when/kt4434.kt
T
2015-10-14 20:39:35 +03:00

28 lines
420 B
Kotlin
Vendored

// KT-4434 Missed diagnostic about else branch in when
package test
fun foo(): Int {
val a = "a"
return if (a.length > 0) {
<!NO_ELSE_IN_WHEN!>when<!> (a) {
"a" -> 1
}
}
else {
3
}
}
fun bar(): Int {
val a = "a"
if (a.length > 0) {
return <!NO_ELSE_IN_WHEN!>when<!> (a) {
"a" -> 1
}
}
else {
return 3
}
}