Files
kotlin-fork/compiler/testData/diagnostics/tests/deprecated/iteratorUsage.kt
T
2015-04-24 15:44:32 +03:00

24 lines
729 B
Kotlin
Vendored

class Iter {
deprecated("text")
fun iterator() : IterIterator = throw Exception()
class IterIterator {
fun hasNext(): Boolean = throw UnsupportedOperationException()
fun next(): String = throw UnsupportedOperationException()
}
}
class Iter2 {
fun iterator() : Iter2Iterator = throw Exception()
class Iter2Iterator {
deprecated("text")
fun hasNext(): Boolean = throw UnsupportedOperationException()
deprecated("text")
fun next(): String = throw UnsupportedOperationException()
}
}
fun use() {
for (x in <!DEPRECATED_SYMBOL_WITH_MESSAGE!>Iter()<!>) {}
for (x in <!DEPRECATED_SYMBOL_WITH_MESSAGE, DEPRECATED_SYMBOL_WITH_MESSAGE!>Iter2()<!>) {}
}