Files
kotlin-fork/compiler/testData/diagnostics/tests/generics/kt9203_1.kt
T
Mikhail Zarechenskiy a3060f1073 Add test on obsolete issue
#KT-9203 Obsolete
2017-09-05 16:15:18 +03:00

18 lines
384 B
Kotlin
Vendored

public interface Collector<T, R>
class A<out T> {
fun foo(): T = null!!
}
public fun <T> toList(): Collector<T, A<T>> = null!!
interface Stream<T> {
public fun <R> collect(collector: Collector<in T, R>): R
}
fun stream(): Stream<String> = null!!
fun main(args: Array<String>) {
val stream: Stream<String> = stream()
val xs = stream.collect(toList())
xs.foo()
}