core: fix type check for loop over iterable.