Fix deprecations in testData
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import java.util.LinkedList
|
||||
|
||||
fun ok1(): Boolean {
|
||||
val queue = linkedListOf(1, 2, 3)
|
||||
val queue = LinkedList(listOf(1, 2, 3))
|
||||
while (!queue.isEmpty()) {
|
||||
queue.poll()
|
||||
for (y in 1..3) {
|
||||
@@ -12,7 +14,7 @@ fun ok1(): Boolean {
|
||||
}
|
||||
|
||||
fun ok2(): Boolean {
|
||||
val queue = linkedListOf(1, 2, 3)
|
||||
val queue = LinkedList(listOf(1, 2, 3))
|
||||
val array = arrayOf(1, 2, 3)
|
||||
while (!queue.isEmpty()) {
|
||||
queue.poll()
|
||||
@@ -26,7 +28,7 @@ fun ok2(): Boolean {
|
||||
}
|
||||
|
||||
fun ok3(): Boolean {
|
||||
val queue = linkedListOf(1, 2, 3)
|
||||
val queue = LinkedList(listOf(1, 2, 3))
|
||||
while (!queue.isEmpty()) {
|
||||
queue.poll()
|
||||
var x = 0
|
||||
|
||||
@@ -7,10 +7,12 @@ World""");
|
||||
}
|
||||
|
||||
fun box() : String {
|
||||
// NOTE: Also tested in stdlib: LineIteratorTest.useLines
|
||||
|
||||
// TODO compiler error
|
||||
// both these expressions causes java.lang.NoClassDefFoundError: collections/CollectionPackage
|
||||
val list1 = sample().useLines{it.toArrayList()}
|
||||
val list2 = sample().useLines<ArrayList<String>>{it.toArrayList()}
|
||||
val list1 = sample().useLines { it.toList() }
|
||||
val list2 = sample().useLines<ArrayList<String>>{ it.toCollection(arrayListOf()) }
|
||||
|
||||
if(arrayListOf("Hello", "World") != list1) return "fail"
|
||||
if(arrayListOf("Hello", "World") != list2) return "fail"
|
||||
|
||||
Reference in New Issue
Block a user