Get rid of reduntant jvm parts in tests

This commit is contained in:
Mikhael Bogdanov
2018-12-21 13:34:40 +01:00
parent f59b6a350f
commit d1efac617d
10 changed files with 22 additions and 34 deletions
+3 -6
View File
@@ -1,14 +1,11 @@
// TARGET_BACKEND: JVM
interface MyIterator<T> {
operator fun hasNext() : Boolean
operator fun next() : T
}
operator fun <T : Any> T?.iterator() = object : MyIterator<T> {
var hasNext = this@iterator != null
private set
private var hasNext = this@iterator != null
override fun hasNext() = hasNext
override fun next() : T {
@@ -16,7 +13,7 @@ operator fun <T : Any> T?.iterator() = object : MyIterator<T> {
hasNext = false
return this@iterator!!
}
throw java.util.NoSuchElementException()
throw NoSuchElementException()
}
}