Files
kotlin/compiler/testData/codegen/box/casts/unitNullableCast.kt
Dmitry Jemerov 48b0afd84d correctly generate safe casts from Unit type
#KT-4494 fixed
2015-03-05 11:59:23 +01:00

8 lines
116 B
Kotlin

fun foo() {}
fun bar(): Int? = foo() as? Int
fun box(): String {
return if (bar() == null) "OK" else "fail"
}