Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/whenIfExprNonNull.kt
T
2015-12-11 15:17:37 +03:00

13 lines
300 B
Kotlin
Vendored

fun baz(s: String?, u: String?): String {
val t = when(s) {
is String -> {
if (u == null) return <!DEBUG_INFO_SMARTCAST!>s<!>
u
}
else -> {
if (u == null) return ""
u
}
}
return <!DEBUG_INFO_SMARTCAST!>t<!>
}