Data flow info: correct disjunction of a type with Nothing: Type U Nothing = Type #KT-9578 Fixed
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
fun foo(s: Any): String {
|
||||
val x = when (s) {
|
||||
is String -> s
|
||||
is Int -> "$s"
|
||||
else -> return ""
|
||||
}
|
||||
|
||||
val y: String = x
|
||||
return y
|
||||
}
|
||||
|
||||
fun box() = if (foo("OK") == "OK" && foo(42) == "42" && foo(true) == "") "OK" else "Fail"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user