Move some tests from boxWithStdlib/ to box/
Move those tests which do not require neither stdlib nor reflect
This commit is contained in:
committed by
Alexander Udalov
parent
54a615fcd3
commit
20e36438e2
@@ -0,0 +1,8 @@
|
||||
class A<T>(t: Array<Array<T>>) {
|
||||
val a:Array<Array<T>> = t
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
A<Int>(arrayOf()) // <- java.lang.VerifyError: (class: A, method: getA signature: ()[[Ljava/lang/Object;) Wrong return type in function
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fun box(): String {
|
||||
A()
|
||||
return "OK"
|
||||
}
|
||||
|
||||
class A: B() {
|
||||
override var foo = arrayOf<Int?>(12, 13)
|
||||
}
|
||||
|
||||
abstract class B {
|
||||
abstract var foo: Array<Int?>
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
private class One {
|
||||
val a1 = arrayOf(
|
||||
object { val fy = "text"}
|
||||
)
|
||||
}
|
||||
|
||||
fun box() = if (One().a1[0].fy == "text") "OK" else "fail"
|
||||
@@ -0,0 +1,16 @@
|
||||
open class B {
|
||||
val name: String
|
||||
get() = "OK"
|
||||
}
|
||||
|
||||
interface A {
|
||||
val name: String
|
||||
}
|
||||
|
||||
class C : B(), A {
|
||||
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return C().name
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
class D {
|
||||
companion object {
|
||||
protected val F: String = "OK"
|
||||
}
|
||||
|
||||
inner class E {
|
||||
fun foo() = F
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return D().E().foo()
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package foo
|
||||
|
||||
import java.util.*;
|
||||
|
||||
fun box() : String {
|
||||
val a = ArrayList<Int>();
|
||||
a.add(1)
|
||||
a.add(2)
|
||||
return if((a.size == 2) && (a.get(1) == 2) && (a.get(0) == 1)) "OK" else "fail"
|
||||
}
|
||||
Reference in New Issue
Block a user