Revert "JVM IR: Implement CHECK_NOT_NULL as a lowering"

This reverts commit dcd72b06d8.

Using a temporary variable has an effect on casts and GC.
This commit is contained in:
pyos
2021-04-15 11:39:41 +02:00
committed by Alexander Udalov
parent f5379c5a04
commit dab693b075
15 changed files with 103 additions and 59 deletions
@@ -0,0 +1,8 @@
// IGNORE_BACKEND: JS, JS_IR, WASM
@Suppress("UNCHECKED_CAST")
fun <T> f() = 1L as T
fun box(): String {
val x: Int = f()!! // T = Int?, but the cast succeeds because it's immediately upcasted to Number
return if (x == 1) "OK" else "fail: $x"
}