Files
kotlin/compiler/testData/codegen/java8/box/useStream.kt
Alexander Udalov 933be1e035 Drop single-file mode of black box codegen tests
Add regression test for #KT-5190
2016-03-02 15:47:39 +03:00

14 lines
363 B
Kotlin
Vendored

// KT-5190 Java 8 Stream.collect couldn't be called
// FULL_JDK
import java.util.stream.Collectors
import java.util.stream.Stream
fun box(): String {
val mutableListOf = mutableListOf("OK", "B", "C")
return test((mutableListOf as java.util.Collection<String>).stream()) as String
}
fun test(a: Stream<String>) = a.collect(Collectors.toList()).first()