Migrate boxAgainstJava tests to multi-file framework
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
package test;
|
||||
|
||||
public class genericConstructor<T extends Number> {
|
||||
public genericConstructor(T number) {}
|
||||
}
|
||||
+12
-2
@@ -1,6 +1,16 @@
|
||||
import test.genericConstructor
|
||||
// FILE: test/Foo.java
|
||||
|
||||
class Subclass : genericConstructor<Int>(42) {
|
||||
package test;
|
||||
|
||||
public class Foo<T extends Number> {
|
||||
public Foo(T number) {}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
import test.Foo
|
||||
|
||||
class Subclass : Foo<Int>(42) {
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
package test;
|
||||
|
||||
public class secondaryConstructor {
|
||||
private final String x;
|
||||
private final String y;
|
||||
|
||||
public secondaryConstructor(String x, String y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public secondaryConstructor(String x) {
|
||||
this(x, "def_y");
|
||||
}
|
||||
|
||||
public secondaryConstructor() {
|
||||
this("def_x");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return x + "#" + y;
|
||||
}
|
||||
}
|
||||
+31
-2
@@ -1,6 +1,35 @@
|
||||
import test.secondaryConstructor;
|
||||
// FILE: test/Foo.java
|
||||
|
||||
class Child : secondaryConstructor {
|
||||
package test;
|
||||
|
||||
public class Foo {
|
||||
private final String x;
|
||||
private final String y;
|
||||
|
||||
public Foo(String x, String y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public Foo(String x) {
|
||||
this(x, "def_y");
|
||||
}
|
||||
|
||||
public Foo() {
|
||||
this("def_x");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return x + "#" + y;
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
import test.Foo;
|
||||
|
||||
class Child : Foo {
|
||||
constructor(): super() {}
|
||||
constructor(x: String): super(x) {}
|
||||
constructor(x: String, y: String): super(x, y) {}
|
||||
|
||||
Reference in New Issue
Block a user