JVM_IR handle @EnhancedNullability types in null check simplification

This commit is contained in:
Dmitry Petrov
2021-09-29 15:30:39 +03:00
committed by teamcityserver
parent cc885f9b24
commit 86b3ea09c2
7 changed files with 85 additions and 7 deletions
@@ -0,0 +1,16 @@
// TARGET_BACKEND: JVM
// FILE: safeCallSimplificationEnhancedNullabilityType.kt
fun String.zap() = "failed"
fun box() =
J.nullString()?.zap()
?: "OK"
// FILE: J.java
import org.jetbrains.annotations.NotNull;
public class J {
@NotNull
public static String nullString() { return null; }
}
@@ -0,0 +1,13 @@
// TARGET_BACKEND: JVM
// FILE: safeCallSimplificationFlexibleType.kt
fun String.zap() = "failed"
fun box() =
J.nullString()?.zap()
?: "OK"
// FILE: J.java
public class J {
public static String nullString() { return null; }
}