Sign in
pigweed
/
third_party
/
github
/
JetBrains
/
kotlin
/
6330def4271b547b5c7db5f9759e387de2908e94
/
.
/
compiler
/
testData
/
codegen
/
box
/
smartCasts
/
whenSmartCast.kt
blob: 8069048ce008c3a1e7071a1a76ccbd104d1ea50a [
file
] [
log
] [
blame
]
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"