By default, RStudio silently runs str(x) whenever you assign a value to the name x in the global environment, in order to populate the Environment pane. As a result,
library("iterators")
x <- iter(1:3)
x$state$i
returns 4L instead of 0L. (str.default evaluates vapply(x, typeof, "") and vapply evaluates as.list.iter(x).) The issue would be resolved if you wrote your own method for str avoiding as.list.iter, or if you moved the functionality of as.list.iter into a different function altogether so that str.default uses as.list.default.
This issue was brought to my attention by a question on Stack Overflow, here.