Source code looks like this:
override /*SeqLike*/
def indexWhere(p: A => Boolean, from: Int): Int = {
var i = from
var these = this drop from
while (these.nonEmpty) {
if (p(these.head))
return i
i += 1
these = these.tail
}
-1
}
So there is no input check, neither zeroing of i
variable. I would say it is a bug. If you can, write it on https://groups.google.com/forum/#!forum/scala-language where devs can take a look at it.