JVM_IR: generate non-null assertions for arguments

This commit is contained in:
pyos
2019-05-20 12:46:38 +02:00
committed by Georgy Bronnikov
parent 266976ac1e
commit 6b2d874ccc
12 changed files with 47 additions and 8 deletions
@@ -3,6 +3,10 @@
// FULL_JDK
// WITH_RUNTIME
// Bridges are not generated because their signatures would conflict. The logic
// should be inserted directly into existing methods, but this is not implemented.
// IGNORE_BACKEND: JVM_IR
class A : MutableMap<Any, Any?> {
override val entries: MutableSet<MutableMap.MutableEntry<Any, Any?>>
get() = throw UnsupportedOperationException()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// TARGET_BACKEND: JVM
// FILE: Test.java
@@ -1,5 +1,4 @@
// !LANGUAGE: -NullabilityAssertionOnExtensionReceiver
// IGNORE_BACKEND: JVM_IR
// TARGET_BACKEND: JVM
// FILE: test.kt
// WITH_RUNTIME
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// TARGET_BACKEND: JVM
// FILE: test.kt
// WITH_RUNTIME
@@ -1,5 +1,4 @@
// !LANGUAGE: -NullabilityAssertionOnExtensionReceiver
// IGNORE_BACKEND: JVM_IR
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// FILE: test.kt
@@ -1,3 +1,7 @@
// Bridges are not generated because their signatures would conflict. The logic
// should be inserted directly into existing methods, but this is not implemented.
// IGNORE_BACKEND: JVM_IR
private object EmptyMap : Map<Any, Nothing> {
override val size: Int get() = 0
override fun isEmpty(): Boolean = true
@@ -1,4 +1,5 @@
// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND: JVM_IR
inline class AsAny(val a: Any?)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
fun foo(s: String) = s as CharSequence
// 0 IFNULL
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
fun test(s: String) = s?.length
// 0 IFNULL