v2: update checker. missing from previous commits

pull/3931/head
Joe Conigliaro 2020-03-05 22:30:16 +11:00
parent ee6a8a41f5
commit 6de44db4eb
1 changed files with 4 additions and 3 deletions

View File

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