1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

parser: fix incorrect unused var message

This commit is contained in:
Toby Webb 2019-10-25 09:27:43 +02:00 committed by Alexander Medvednikov
parent 4443fef6c3
commit c456ba6bde

View File

@ -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