K1/K2: add a group of BB test around primitives in Java

Related to KT-62554, KT-63242
This commit is contained in:
Mikhail Glukhikh
2024-01-22 18:12:48 +01:00
committed by Space Team
parent e42c1be354
commit 51093a4764
27 changed files with 724 additions and 53 deletions
@@ -0,0 +1,21 @@
// TARGET_BACKEND: JVM_IR
// ISSUE: KT-62554
// FILE: A.java
public class A {
public String foo(Integer x) {
return "FAIL";
}
}
// FILE: main.kt
interface B {
fun foo(x: Int) = "OK"
}
class C : A(), B
fun box(): String {
return C().foo(42)
}
@@ -0,0 +1,23 @@
// TARGET_BACKEND: JVM_IR
// ISSUE: KT-62554
// FILE: A.java
public class A<T> {
public T foo(Integer x) {
return null;
}
}
// FILE: main.kt
interface B {
fun foo(x: Int) = "OK"
}
open class C : A<String>()
class D : C(), B
fun box(): String {
return D().foo(42)
}
@@ -0,0 +1,25 @@
// TARGET_BACKEND: JVM_IR
// ISSUE: KT-62554
// FILE: A.java
public class A<T> {
public String foo(T x) {
return "FAIL";
}
}
// FILE: C.java
public class C extends A<Integer> {}
// FILE: main.kt
interface B {
fun foo(x: Int) = "OK"
}
class D : C(), B
fun box(): String {
return D().foo(42)
}
@@ -0,0 +1,23 @@
// TARGET_BACKEND: JVM_IR
// ISSUE: KT-62554
// FILE: A.java
public class A<T> {
public String foo(T x) {
return "FAIL";
}
}
// FILE: main.kt
interface B {
fun foo(x: Int) = "OK"
}
open class C : A<Int>()
class D : C(), B
fun box(): String {
return D().foo(42)
}
@@ -0,0 +1,23 @@
// TARGET_BACKEND: JVM_IR
// ISSUE: KT-62554
// FILE: A.java
public class A {
public String foo(Integer x) {
return "FAIL";
}
}
// FILE: main.kt
interface B<T> {
fun foo(x: T) = "OK"
}
interface D : B<Int>
class E : A(), D
fun box(): String {
return E().foo(42)
}
@@ -0,0 +1,23 @@
// TARGET_BACKEND: JVM_IR
// ISSUE: KT-62554
// FILE: A.java
import org.jetbrains.annotations.*;
public class A {
public String foo(@Nullable Integer x) {
return "FAIL";
}
}
// FILE: main.kt
interface B {
fun foo(x: Int) = "OK"
}
class C : A(), B
fun box(): String {
return C().foo(42)
}