Files
kotlin-fork/backend.native/tests/codegen/boxing/boxing11.kt
T
2016-12-20 15:33:38 +07:00

12 lines
211 B
Kotlin

fun printInt(x: Int) = println(x)
class Foo(val value: Int?) {
fun foo() {
printInt(if (value != null) value else 42)
}
}
fun main(args: Array<String>) {
Foo(17).foo()
Foo(null).foo()
}