Yes, it is weird, but consistent. Note that in the second case you don't change the loop variable (the class reference, which is a pointer), but call a method on it, which is allowed. Secondary effects of that (freeing the class, turning the reference stale) can't be modelled by for ... in.