JVM_IR: keep nullability when remapping type parameters

This commit is contained in:
pyos
2019-12-20 13:43:46 +01:00
committed by Georgy Bronnikov
parent 1b95040934
commit 17d2fda946
7 changed files with 72 additions and 1 deletions
@@ -0,0 +1,22 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// FILE: a.kt
interface I {
fun <T : String> f(x: T) = x
}
class C : I
fun box() = try {
B.f()
"FAIL"
} catch (e: IllegalArgumentException) {
"OK"
}
// FILE: B.java
public class B {
public static String f() {
return new C().<String>f(null);
}
}
@@ -0,0 +1,9 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
interface I {
fun <T : String> f(x: T?) = x ?: "OK"
}
class C : I
fun box() = C().f<String>(null)