Move around some codegen box tests
In tests merged from boxAgainstJava in 29b96aa1, some directories were
named slightly differently compared to box, e.g. "property" vs
"properties", "varargs" vs "vararg". This change renames these, moves
some of the tests to more fitting directories, and also renames
"visibility" to "javaVisibility" because it's about Java visibilities
specifically.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// MODULE: lib
|
||||
// FILE: A.java
|
||||
|
||||
public abstract class A<T> {
|
||||
protected abstract String doIt(T... args);
|
||||
|
||||
public String test(T... args) {
|
||||
return doIt(args);
|
||||
}
|
||||
}
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: 1.kt
|
||||
|
||||
val a: A<Void> =
|
||||
object : A<Void>() {
|
||||
override fun doIt(vararg parameters: Void): String = "OK"
|
||||
}
|
||||
|
||||
fun box(): String = a.test()
|
||||
@@ -0,0 +1,24 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// MODULE: lib
|
||||
// FILE: A.java
|
||||
|
||||
public abstract class A<T> {
|
||||
protected abstract String doIt(T... args);
|
||||
|
||||
public <S extends T> String test(S... args) {
|
||||
return doIt(args);
|
||||
}
|
||||
}
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: 1.kt
|
||||
|
||||
open class Super
|
||||
class Sub: Super()
|
||||
|
||||
val a: A<Super> =
|
||||
object : A<Super>() {
|
||||
override fun doIt(vararg parameters: Super): String = "OK"
|
||||
}
|
||||
|
||||
fun box(): String = a.test<Sub>()
|
||||
@@ -0,0 +1,41 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// TARGET_BACKEND: JVM
|
||||
// MODULE: lib
|
||||
// FILE: A.java
|
||||
|
||||
public abstract class A<T> {
|
||||
protected abstract String doIt(T... args);
|
||||
|
||||
class B<S extends T, U extends S> {
|
||||
public String test(T... args) {
|
||||
return doIt(args);
|
||||
}
|
||||
|
||||
public String test2(S... args) {
|
||||
return doIt(args);
|
||||
}
|
||||
|
||||
public String test3(U... args) {
|
||||
return doIt(args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: 1.kt
|
||||
|
||||
open class Super
|
||||
open class Sub: Super()
|
||||
class Sub2: Sub()
|
||||
|
||||
val a: A<Super> =
|
||||
object : A<Super>() {
|
||||
override fun doIt(vararg parameters: Super): String = "OK"
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val b = a.B<Sub, Sub2>()
|
||||
if (b.test() != "OK") return "FAIL1"
|
||||
if (b.test2() != "OK") return "FAIL2"
|
||||
return b.test3()
|
||||
}
|
||||
Reference in New Issue
Block a user