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:
+28
@@ -0,0 +1,28 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// MODULE: lib
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
protected final String protectedProperty;
|
||||
|
||||
public J(String str) {
|
||||
protectedProperty = str;
|
||||
}
|
||||
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: 1.kt
|
||||
|
||||
class A : J(J.protectedFun()) {
|
||||
fun test(): String {
|
||||
return protectedProperty!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return A().test()
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// MODULE: lib
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: 1.kt
|
||||
|
||||
class A {
|
||||
companion object : J() {
|
||||
fun test(): String {
|
||||
return J.protectedFun()!!
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return A.test()
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// MODULE: lib
|
||||
// FILE: J.java
|
||||
|
||||
public class J<T> {
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: 1.kt
|
||||
|
||||
class Derived : J<String>() {
|
||||
fun test(): String {
|
||||
return J.protectedFun()!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return Derived().test()
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// MODULE: lib
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
public static class Inner {
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: 1.kt
|
||||
|
||||
class Derived : J.Inner() {
|
||||
fun test(): String {
|
||||
return J.Inner.protectedFun()!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return Derived().test()
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// MODULE: lib
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
public static class A {
|
||||
public static class B {
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: 1.kt
|
||||
|
||||
class Derived : J.A.B() {
|
||||
fun test(): String {
|
||||
return J.A.B.protectedFun()!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return Derived().test()
|
||||
}
|
||||
Vendored
+24
@@ -0,0 +1,24 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// MODULE: lib
|
||||
// FILE: J.java
|
||||
|
||||
public class J<T> {
|
||||
public static class Inner<S> {
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: 1.kt
|
||||
|
||||
class Derived : J.Inner<String>() {
|
||||
fun test(): String {
|
||||
return J.Inner.protectedFun()!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return Derived().test()
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// MODULE: lib
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: 1.kt
|
||||
|
||||
open class A : J() {}
|
||||
|
||||
class Derived : A() {
|
||||
fun test(): String {
|
||||
return J.protectedFun()!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return Derived().test()
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// MODULE: lib
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: 1.kt
|
||||
|
||||
object A : J() {
|
||||
fun test(): String {
|
||||
return J.protectedFun()!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return A.test()
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// MODULE: lib
|
||||
// FILE: Base.java
|
||||
|
||||
public class Base {
|
||||
protected static class Inner {
|
||||
public Inner() {}
|
||||
public String foo() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: 1.kt
|
||||
|
||||
class Derived : Base() {
|
||||
fun test(): String {
|
||||
return Base.Inner().foo()!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return Derived().test()
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// MODULE: lib
|
||||
// FILE: Base.java
|
||||
|
||||
public class Base {
|
||||
public static class A {
|
||||
protected static class B {
|
||||
public B() {
|
||||
}
|
||||
|
||||
public String foo() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: 1.kt
|
||||
|
||||
class Derived : Base.A() {
|
||||
fun test(): String {
|
||||
return Base.A.B().foo()!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return Derived().test()
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// MODULE: lib
|
||||
// FILE: Base.java
|
||||
|
||||
public class Base {
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: 1.kt
|
||||
|
||||
class Derived : Base() {
|
||||
fun test(): String {
|
||||
return Base.protectedFun()!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return Derived().test()
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// MODULE: lib
|
||||
// FILE: Base.java
|
||||
|
||||
public class Base {
|
||||
protected static final String protectedProperty = "OK";
|
||||
}
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: 1.kt
|
||||
|
||||
class Derived : Base() {
|
||||
fun test(): String {
|
||||
return Base.protectedProperty!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return Derived().test()
|
||||
}
|
||||
Reference in New Issue
Block a user