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

21 lines
350 B
Kotlin

package codegen.boxing.boxing2
import kotlin.test.*
fun printInt(x: Int) = println(x)
fun printBoolean(x: Boolean) = println(x)
fun foo(arg: Any) {
if (arg is Int)
printInt(arg)
else if (arg is Boolean)
printBoolean(arg)
else
println("other")
}
@Test fun runTest() {
foo(1)
foo(true)
foo("Hello")
}