diff --git a/vlib/v/gen/c/comptime.v b/vlib/v/gen/c/comptime.v index 7ba552c364..1b59babafe 100644 --- a/vlib/v/gen/c/comptime.v +++ b/vlib/v/gen/c/comptime.v @@ -405,11 +405,16 @@ fn (mut g Gen) comp_for(node ast.CompFor) { g.stmts(node.stmts) i++ g.writeln('}') + // + mut delete_keys := []string{} for key, _ in g.comptime_var_type_map { if key.starts_with(node.val_var) { - g.comptime_var_type_map.delete(key) + delete_keys << key } } + for key in delete_keys { + g.comptime_var_type_map.delete(key) + } } } else if node.kind == .fields { // TODO add fields