diff --git a/vyper/codegen/stmt.py b/vyper/codegen/stmt.py index 965e442ab6..0b6e813816 100644 --- a/vyper/codegen/stmt.py +++ b/vyper/codegen/stmt.py @@ -214,9 +214,10 @@ def _parse_For_range(self): raise TypeCheckFailure("unreachable: unchecked 0 bound") varname = self.stmt.target.target.id - assert varname not in forvars i = IRnode.from_list(self.context.fresh_varname("range_ix"), typ=target_type) + + assert varname not in self.context.forvars self.context.forvars[varname] = i loop_body = ["seq"]