diff --git a/vlib/compiler/parser.v b/vlib/compiler/parser.v index 07ae9a83cb..0ff8619181 100644 --- a/vlib/compiler/parser.v +++ b/vlib/compiler/parser.v @@ -2623,6 +2623,7 @@ fn (p mut Parser) assoc() string { p.error('unknown variable `$name`') exit(1) } + p.mark_var_used(var) p.check(.pipe) p.gen('($var.typ){') mut fields := []string// track the fields user is setting, the rest will be copied from the old object