generates remove method

throwing exception
in Kotlin class extending Iterator
This commit is contained in:
Svetlana Isakova
2012-08-15 19:46:35 +04:00
parent 293452e375
commit 96d99d19f3
7 changed files with 77 additions and 12 deletions
@@ -0,0 +1,13 @@
fun box() : String {
try {
removeInIterator.bar(object : Iterator<Int> {
public override fun hasNext(): Boolean = false
public override fun next(): Int = 1
})
}
catch (e: UnsupportedOperationException) {
if (e.getMessage() == "Mutating method called on a Kotlin Iterator")
return "OK"
}
return "fail"
}