From c456ba6bde8186b64f87f43eb3443cbc9dbcd7cc Mon Sep 17 00:00:00 2001 From: Toby Webb Date: Fri, 25 Oct 2019 09:27:43 +0200 Subject: [PATCH] parser: fix incorrect unused var message --- vlib/compiler/parser.v | 1 + 1 file changed, 1 insertion(+) 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