Files
kotlin/compiler/testData/codegen/bytecodeText/boxingOptimization/nullCheck.kt
2015-04-07 17:28:01 +03:00

19 lines
282 B
Kotlin

inline fun <R, T> foo(x : R?, y : R?, block : (R?) -> T) : T {
if (x == null) {
return block(x)
} else {
return block(y)
}
}
fun bar() {
foo(1, 2) { x -> if (x != null) 1 else 2 }
}
// 0 valueOf
// 0 Value\s\(\)
// 0 IFNULL
// 1 IFNONNULL
// 1 IF