Files
kotlin-fork/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt864.kt
T
Alexander Udalov 72aa3d1465 Use mock JDK in compiler tests where full JDK is not needed
- move some of boxWithStdlib tests under fullJdk/ directory, where they will be
  compiled against the full JDK
- introduce FULL_JDK in-text directive for the reflection test as only 4 tests
  out of 654 needed the full JDK
2015-04-02 21:57:48 +03:00

20 lines
542 B
Kotlin

import kotlin.util.*
import java.io.*
import java.util.*
fun sample() : Reader {
return StringReader("""Hello
World""");
}
fun box() : String {
// 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()}
if(arrayList("Hello", "World") != list1) return "fail"
if(arrayList("Hello", "World") != list2) return "fail"
return "OK"
}