mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 08:31:29 +00:00
New null check assertions are generated a bit more efficiently, with a call to `checkNotNull` instead of IFNONNULL+jump.
20 lines
233 B
Kotlin
Vendored
20 lines
233 B
Kotlin
Vendored
class A
|
|
fun box() {
|
|
val x: A? = A()
|
|
val y: A?
|
|
if (1 == 0) {
|
|
y = x
|
|
}
|
|
else {
|
|
y = null
|
|
}
|
|
|
|
y!!
|
|
}
|
|
|
|
// 0 IFNULL
|
|
// 0 IFNONNULL
|
|
// 0 ATHROW
|
|
// 1 checkNotNull \(Ljava/lang/Object;\)V
|
|
// 0 throwNpe
|