backend: enable and add tests for autoboxing
This commit is contained in:
committed by
SvyatoslavScherbina
parent
61c28db886
commit
f2b5b98dba
@@ -0,0 +1,17 @@
|
||||
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")
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
foo(1)
|
||||
foo(true)
|
||||
foo("Hello")
|
||||
}
|
||||
Reference in New Issue
Block a user