JVM_IR: keep nullability when remapping type parameters
This commit is contained in:
+22
@@ -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);
|
||||
}
|
||||
}
|
||||
+9
@@ -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)
|
||||
Reference in New Issue
Block a user