Files
kotlin-fork/j2k/testData/fileOrElement/projections/projections.kt
T
2016-12-14 13:35:31 +03:00

22 lines
425 B
Kotlin
Vendored

import java.util.ArrayList
internal class C<T> {
fun foo1(src: Collection<T>) {
val t = src.iterator().next()
}
fun foo2(src: ArrayList<out T>) {
val t = src.iterator().next()
}
fun foo3(dst: MutableCollection<in T>, t: T) {
dst.add(t)
}
fun foo4(comparable: Comparable<T>, t: T): Int {
return comparable.compareTo(t)
}
fun foo5(w: Collection<*>) {}
}