Files
kotlin-fork/backend.native/tests/codegen/boxing/boxing7.kt
T
2017-10-20 18:25:05 +03:00

19 lines
284 B
Kotlin

package codegen.boxing.boxing7
import kotlin.test.*
fun printInt(x: Int) = println(x)
fun foo(arg: Any) {
val argAsInt = try {
arg as Int
} catch (e: ClassCastException) {
0
}
printInt(argAsInt)
}
@Test fun runTest() {
foo(1)
foo("Hello")
}