Files
kotlin-fork/compiler/testData/diagnostics/tests/j+k/kt2394.kt
T
2015-04-29 16:33:24 +02:00

16 lines
441 B
Kotlin
Vendored

// !CHECK_TYPE
//KT-2394 java.lang.Iterable<T> should be visible as kotlin.Iterable<out T>
package d
fun foo(iterable: Iterable<Int>, iterator: Iterator<Int>, comparable: Comparable<Any>) {
checkSubtype<Iterable<Any>>(iterable)
checkSubtype<Iterator<Any>>(iterator)
checkSubtype<Comparable<String>>(comparable)
}
fun bar(c: Collection<Int>) {
checkSubtype<Iterable<Any>>(c)
checkSubtype<Iterator<Any>>(c.iterator())
}