Files
kotlin-fork/compiler/testData/diagnostics/tests/extensions/GenericIterator2.kt
T
2015-09-25 19:20:20 +03:00

16 lines
330 B
Kotlin
Vendored

// !CHECK_TYPE
import java.util.Enumeration
operator fun <T> java.util.Enumeration<T>.iterator() = object : Iterator<T> {
public override fun hasNext(): Boolean = hasMoreElements()
public override fun next() = nextElement()
}
fun a(e : java.util.Enumeration<Int>) {
for (i in e) {
checkSubtype<Int>(i)
}
}