Sign in
pigweed
/
third_party
/
github
/
JetBrains
/
kotlin
/
9fc4d94d04f972782fee2dc5b3b25d052d88601a
/
.
/
compiler
/
testData
/
codegen
/
box
/
when
/
exceptionOnNoMatch.kt
blob: cc2507f82ef7f5df9bb3e4475063950c8566a7b8 [
file
]
fun isZero
(
x
:
Int
)
=
when
(
x
)
{
0
->
true
else
->
throw
Exception
()
}
fun box
():
String
{
try
{
isZero
(
1
)
}
catch
(
e
:
Exception
)
{
return
"OK"
}
return
"Fail"
}