JVM_IR KT-50193 result of !! is non-null

This commit is contained in:
Dmitry Petrov
2021-12-13 16:30:05 +03:00
committed by TeamCityServer
parent 343a860553
commit 34c70ea04e
12 changed files with 117 additions and 7 deletions
@@ -0,0 +1,17 @@
// FULL_JDK
import java.lang.ref.WeakReference
fun func1(x: Any) {}
fun func2() {
func1(WeakReference(Any()).get()!!)
}
// 0 ASTORE
// ^ no temporary variables created in 'func2'
// 1 ALOAD
// ^ single ALOAD in 'func1' (parameter null check)
// JVM_IR_TEMPLATES
// 0 checkNotNullExpressionValue
// ^ no null check on result of 'get()!!'