Accurate representation of smart casts on complex expressions
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
fun baz(s: String?): Int {
|
||||
if (s == null) return 0
|
||||
return when(s) {
|
||||
"abc" -> s
|
||||
else -> "xyz"
|
||||
}.length
|
||||
}
|
||||
|
||||
fun box() = if (baz("abc") == 3 && baz("") == 3 && baz(null) == 0) "OK" else "FAIL"
|
||||
Reference in New Issue
Block a user