added test case to investigate KT-2495

This commit is contained in:
James Strachan
2012-07-26 05:06:05 -04:00
parent 1b5dc60ac2
commit 1691298539
@@ -0,0 +1,20 @@
package regressions
import kotlin.test.assertEquals
import org.junit.Test as test
fun f(xs: java.util.Iterator<Int>): Int {
var answer = 0
for (x in xs) {
answer += x
}
return answer
}
class Kt2495Test {
test fun duplicateIteratorsBug() {
val list = arrayList(1, 2, 3)
val result = f(list.iterator()!!)
assertEquals(6, result)
}
}