use kotlin Iterable/Iterator
instead of java Iterable/Iterator in Kotlin code in tests
This commit is contained in:
@@ -2,8 +2,8 @@ trait ISized {
|
||||
val size : Int
|
||||
}
|
||||
|
||||
trait javaUtilIterator<T> : java.util.Iterator<T> {
|
||||
override fun remove() : Unit {
|
||||
trait javaUtilIterator<T> : Iterator<T> {
|
||||
fun remove() : Unit {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
}
|
||||
@@ -16,14 +16,14 @@ class MyIterator<T>(val array : ReadOnlyArray<T>) : javaUtilIterator<T> {
|
||||
override fun next() : T = array.get(index++)
|
||||
}
|
||||
|
||||
trait ReadOnlyArray<out T> : ISized, java.lang.Iterable<T> {
|
||||
trait ReadOnlyArray<out T> : ISized, Iterable<T> {
|
||||
fun get(index : Int) : T
|
||||
|
||||
class Default {
|
||||
fun check(v: Any) = v is T
|
||||
}
|
||||
|
||||
override fun iterator() : java.util.Iterator<T> = MyIterator<T>(this)
|
||||
override fun iterator() : Iterator<T> = MyIterator<T>(this)
|
||||
}
|
||||
|
||||
trait WriteOnlyArray<in T> : ISized {
|
||||
|
||||
Reference in New Issue
Block a user