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

v2: update checker. missing from previous commits

This commit is contained in:
Joe Conigliaro 2020-03-05 22:30:16 +11:00
parent ee6a8a41f5
commit 6de44db4eb

View File

@ -416,9 +416,10 @@ fn (c mut Checker) stmt(node ast.Stmt) {
for i, expr in it.exprs { for i, expr in it.exprs {
mut field := it.fields[i] mut field := it.fields[i]
typ := c.expr(expr) typ := c.expr(expr)
mut xconst := c.table.consts[field.name] c.table.register_const(table.Var{
xconst.typ = typ name: field.name
c.table.consts[field.name] = xconst typ: typ
})
field.typ = typ field.typ = typ
it.fields[i] = field it.fields[i] = field
} }