Fix deprecations in testData: BlackBoxWithStdLibCodegenTest
This commit is contained in:
@@ -9,7 +9,7 @@ fun f(xs: Iterator<Int>): Int {
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val list = arrayList(1, 2, 3)
|
||||
val list = arrayListOf(1, 2, 3)
|
||||
val result = f(list.iterator())
|
||||
return if (6 == result) "OK" else "fail"
|
||||
}
|
||||
+1
-1
@@ -11,7 +11,7 @@ class ClassWithGenericSuperInterface: java.util.Comparator<String> {
|
||||
fun check(klass: Class<*>) {
|
||||
val interfaces = klass.getInterfaces().toList()
|
||||
val genericInterfaces = klass.getGenericInterfaces().toList()
|
||||
if (interfaces.size != genericInterfaces.size) {
|
||||
if (interfaces.size() != genericInterfaces.size()) {
|
||||
throw AssertionError("interfaces=$interfaces, genericInterfaces=$genericInterfaces")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ public fun <T: Comparable<T>> Collection<T>.testMin(): T? {
|
||||
}
|
||||
|
||||
fun box() : String {
|
||||
val users = arrayList(
|
||||
val users = arrayListOf(
|
||||
User("John", "Doe", 30),
|
||||
User("Jane", "Doe", 27))
|
||||
|
||||
|
||||
@@ -3,6 +3,6 @@ class A<T>(t: Array<Array<T>>) {
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
A<Int>(array()) // <- java.lang.VerifyError: (class: A, method: getA signature: ()[[Ljava/lang/Object;) Wrong return type in function
|
||||
A<Int>(arrayOf()) // <- java.lang.VerifyError: (class: A, method: getA signature: ()[[Ljava/lang/Object;) Wrong return type in function
|
||||
return "OK"
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
fun box(): String {
|
||||
val list = array("a", "c", "b").toSortedList()
|
||||
val list = arrayOf("a", "c", "b").sorted()
|
||||
return if (list.toString() == "[a, b, c]") "OK" else "Fail: $list"
|
||||
}
|
||||
|
||||
@@ -8,5 +8,5 @@ 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"
|
||||
return if((a.size() == 2) && (a.get(1) == 2) && (a.get(0) == 1)) "OK" else "fail"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user