fix #606 typechecking of for loop iterated expression