Migrate boxAgainstJava tests to multi-file framework
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
import java.lang.String;
|
||||
|
||||
class J {
|
||||
String value;
|
||||
|
||||
J(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
@@ -1 +1,15 @@
|
||||
// FILE: J.java
|
||||
|
||||
import java.lang.String;
|
||||
|
||||
class J {
|
||||
String value;
|
||||
|
||||
J(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
fun box() = J("OK").value
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
package protectedPack;
|
||||
|
||||
import java.lang.String;
|
||||
|
||||
class packageClass {
|
||||
public String test() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
+13
-1
@@ -1,5 +1,17 @@
|
||||
// FILE: protectedPack/J.java
|
||||
|
||||
package protectedPack;
|
||||
|
||||
class J {
|
||||
public String test() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
package protectedPack
|
||||
|
||||
fun box(): String {
|
||||
return packageClass().test()!!
|
||||
return J().test()!!
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
package protectedPack;
|
||||
|
||||
import java.lang.String;
|
||||
|
||||
public class packageFun {
|
||||
String test() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,17 @@
|
||||
// FILE: protectedPack/J.java
|
||||
|
||||
package protectedPack;
|
||||
|
||||
public class J {
|
||||
String test() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
package protectedPack
|
||||
|
||||
fun box(): String {
|
||||
return packageFun().test()!!
|
||||
return J().test()!!
|
||||
}
|
||||
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
package protectedPack;
|
||||
|
||||
import java.lang.String;
|
||||
|
||||
public class packageProperty {
|
||||
String test = "OK";
|
||||
}
|
||||
+11
-1
@@ -1,5 +1,15 @@
|
||||
// FILE: protectedPack/J.java
|
||||
|
||||
package protectedPack;
|
||||
|
||||
public class J {
|
||||
String test = "OK";
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
package protectedPack
|
||||
|
||||
fun box(): String {
|
||||
return packageProperty().test!!
|
||||
return J().test!!
|
||||
}
|
||||
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
package protectedPack;
|
||||
|
||||
import java.lang.String;
|
||||
|
||||
public class overrideProtectedFunInPackage {
|
||||
protected String foo() {
|
||||
return "fail";
|
||||
}
|
||||
}
|
||||
+14
-2
@@ -1,8 +1,20 @@
|
||||
// FILE: protectedPack/J.java
|
||||
|
||||
package protectedPack;
|
||||
|
||||
public class J {
|
||||
protected String foo() {
|
||||
return "fail";
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
package protectedPackKotlin
|
||||
|
||||
import protectedPack.overrideProtectedFunInPackage
|
||||
import protectedPack.J
|
||||
|
||||
class Derived: overrideProtectedFunInPackage() {
|
||||
class Derived : J() {
|
||||
protected override fun foo(): String? {
|
||||
return "OK"
|
||||
}
|
||||
|
||||
Vendored
-9
@@ -1,9 +0,0 @@
|
||||
package protectedPack;
|
||||
|
||||
import java.lang.String;
|
||||
|
||||
public class protectedFunInPackage {
|
||||
protected String foo() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
Vendored
+13
-1
@@ -1,5 +1,17 @@
|
||||
// FILE: protectedPack/J.java
|
||||
|
||||
package protectedPack;
|
||||
|
||||
public class J {
|
||||
protected String foo() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
package protectedPack
|
||||
|
||||
fun box(): String {
|
||||
return protectedFunInPackage().foo()!!
|
||||
return J().foo()!!
|
||||
}
|
||||
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
package protectedPack;
|
||||
|
||||
import java.lang.String;
|
||||
|
||||
public class protectedPropertyInPackage {
|
||||
protected String foo = "OK";
|
||||
}
|
||||
+11
-1
@@ -1,5 +1,15 @@
|
||||
// FILE: protectedPack/J.java
|
||||
|
||||
package protectedPack;
|
||||
|
||||
public class J {
|
||||
protected String foo = "OK";
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
package protectedPack
|
||||
|
||||
fun box(): String {
|
||||
return protectedPropertyInPackage().foo!!
|
||||
return J().foo!!
|
||||
}
|
||||
|
||||
Vendored
-11
@@ -1,11 +0,0 @@
|
||||
package protectedPack;
|
||||
|
||||
import java.lang.String;
|
||||
|
||||
public class protectedStaticClass {
|
||||
protected static class Inner {
|
||||
public String foo() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+17
-3
@@ -1,11 +1,25 @@
|
||||
// FILE: protectedPack/J.java
|
||||
|
||||
package protectedPack;
|
||||
|
||||
public class J {
|
||||
protected static class Inner {
|
||||
public String foo() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
package protectedPack
|
||||
|
||||
class Derived(): protectedStaticClass() {
|
||||
class Derived : J() {
|
||||
fun test(): String {
|
||||
return protectedStaticClass.Inner().foo()!!
|
||||
return J.Inner().foo()!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return Derived().test()
|
||||
return Derived().test()
|
||||
}
|
||||
|
||||
Vendored
-12
@@ -1,12 +0,0 @@
|
||||
public class funCallInConstructor {
|
||||
|
||||
protected final String protectedProperty;
|
||||
|
||||
public funCallInConstructor(String str) {
|
||||
protectedProperty = str;
|
||||
}
|
||||
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
Vendored
+21
-5
@@ -1,9 +1,25 @@
|
||||
class A: funCallInConstructor(funCallInConstructor.protectedFun()) {
|
||||
fun test(): String {
|
||||
return protectedProperty!!
|
||||
}
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
protected final String protectedProperty;
|
||||
|
||||
public J(String str) {
|
||||
protectedProperty = str;
|
||||
}
|
||||
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
class A : J(J.protectedFun()) {
|
||||
fun test(): String {
|
||||
return protectedProperty!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return A().test()
|
||||
return A().test()
|
||||
}
|
||||
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
public class funClassObject {
|
||||
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
+16
-6
@@ -1,11 +1,21 @@
|
||||
class A {
|
||||
companion object: funClassObject() {
|
||||
fun test(): String {
|
||||
return funClassObject.protectedFun()!!
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
class A {
|
||||
companion object : J() {
|
||||
fun test(): String {
|
||||
return J.protectedFun()!!
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return A.test()
|
||||
return A.test()
|
||||
}
|
||||
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
public class funGenericClass<T> {
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
+13
-3
@@ -1,9 +1,19 @@
|
||||
class Derived(): funGenericClass<String>() {
|
||||
// FILE: J.java
|
||||
|
||||
public class J<T> {
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
class Derived : J<String>() {
|
||||
fun test(): String {
|
||||
return funGenericClass.protectedFun()!!
|
||||
return J.protectedFun()!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return Derived().test()
|
||||
return Derived().test()
|
||||
}
|
||||
|
||||
Vendored
-7
@@ -1,7 +0,0 @@
|
||||
public class funNestedStaticClass {
|
||||
public static class Inner {
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+15
-3
@@ -1,9 +1,21 @@
|
||||
class Derived(): funNestedStaticClass.Inner() {
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
public static class Inner {
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
class Derived : J.Inner() {
|
||||
fun test(): String {
|
||||
return funNestedStaticClass.Inner.protectedFun()!!
|
||||
return J.Inner.protectedFun()!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return Derived().test()
|
||||
return Derived().test()
|
||||
}
|
||||
|
||||
Vendored
-9
@@ -1,9 +0,0 @@
|
||||
public class funNestedStaticClass2 {
|
||||
public static class A {
|
||||
public static class B {
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+17
-3
@@ -1,9 +1,23 @@
|
||||
class Derived(): funNestedStaticClass2.A.B() {
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
public static class A {
|
||||
public static class B {
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
class Derived : J.A.B() {
|
||||
fun test(): String {
|
||||
return funNestedStaticClass2.A.B.protectedFun()!!
|
||||
return J.A.B.protectedFun()!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return Derived().test()
|
||||
return Derived().test()
|
||||
}
|
||||
|
||||
compiler/testData/codegen/boxAgainstJava/visibility/protectedStatic/funNestedStaticGenericClass.java
Vendored
-7
@@ -1,7 +0,0 @@
|
||||
public class funNestedStaticGenericClass<T> {
|
||||
public static class Inner<S> {
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+15
-3
@@ -1,9 +1,21 @@
|
||||
class Derived(): funNestedStaticGenericClass.Inner<String>() {
|
||||
// FILE: J.java
|
||||
|
||||
public class J<T> {
|
||||
public static class Inner<S> {
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
class Derived : J.Inner<String>() {
|
||||
fun test(): String {
|
||||
return funNestedStaticGenericClass.Inner.protectedFun()!!
|
||||
return J.Inner.protectedFun()!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return Derived().test()
|
||||
return Derived().test()
|
||||
}
|
||||
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
public class funNotDirectSuperClass {
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
Vendored
+14
-5
@@ -1,12 +1,21 @@
|
||||
open class A : funNotDirectSuperClass() {}
|
||||
// FILE: J.java
|
||||
|
||||
class Derived(): A() {
|
||||
public class J {
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
open class A : J() {}
|
||||
|
||||
class Derived : A() {
|
||||
fun test(): String {
|
||||
return funNotDirectSuperClass.protectedFun()!!
|
||||
return J.protectedFun()!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return Derived().test()
|
||||
return Derived().test()
|
||||
}
|
||||
|
||||
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
public class funObject {
|
||||
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
+15
-5
@@ -1,9 +1,19 @@
|
||||
object A: funObject() {
|
||||
fun test(): String {
|
||||
return funObject.protectedFun()!!
|
||||
}
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
object A : J() {
|
||||
fun test(): String {
|
||||
return J.protectedFun()!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return A.test()
|
||||
return A.test()
|
||||
}
|
||||
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
public class simpleClass {
|
||||
protected static class Inner {
|
||||
public Inner() {}
|
||||
public String foo() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
}
|
||||
+16
-3
@@ -1,9 +1,22 @@
|
||||
class Derived(): simpleClass() {
|
||||
// FILE: Base.java
|
||||
|
||||
public class Base {
|
||||
protected static class Inner {
|
||||
public Inner() {}
|
||||
public String foo() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
class Derived : Base() {
|
||||
fun test(): String {
|
||||
return simpleClass.Inner().foo()!!
|
||||
return Base.Inner().foo()!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return Derived().test()
|
||||
return Derived().test()
|
||||
}
|
||||
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
public class simpleClass2 {
|
||||
public static class A {
|
||||
protected static class B {
|
||||
public B() {
|
||||
}
|
||||
|
||||
public String foo() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+20
-3
@@ -1,9 +1,26 @@
|
||||
class Derived(): simpleClass2.A() {
|
||||
// FILE: Base.java
|
||||
|
||||
public class Base {
|
||||
public static class A {
|
||||
protected static class B {
|
||||
public B() {
|
||||
}
|
||||
|
||||
public String foo() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
class Derived : Base.A() {
|
||||
fun test(): String {
|
||||
return simpleClass2.A.B().foo()!!
|
||||
return Base.A.B().foo()!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return Derived().test()
|
||||
return Derived().test()
|
||||
}
|
||||
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
public class simpleFun {
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
+13
-3
@@ -1,9 +1,19 @@
|
||||
class Derived(): simpleFun() {
|
||||
// FILE: Base.java
|
||||
|
||||
public class Base {
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
class Derived : Base() {
|
||||
fun test(): String {
|
||||
return simpleFun.protectedFun()!!
|
||||
return Base.protectedFun()!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return Derived().test()
|
||||
return Derived().test()
|
||||
}
|
||||
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
public class simpleProperty {
|
||||
protected static final String protectedProperty = "OK";
|
||||
}
|
||||
+11
-4
@@ -1,10 +1,17 @@
|
||||
class Derived(): simpleProperty() {
|
||||
// FILE: Base.java
|
||||
|
||||
public class Base {
|
||||
protected static final String protectedProperty = "OK";
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
class Derived : Base() {
|
||||
fun test(): String {
|
||||
return simpleProperty.protectedProperty!!
|
||||
return Base.protectedProperty!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return Derived().test()
|
||||
return Derived().test()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user