checker: ForInStmt only call table.value_type once

pull/4057/head
Joe Conigliaro 2020-03-18 23:29:28 +11:00
parent 4262ff76c3
commit 5fb90e12b1
1 changed files with 3 additions and 2 deletions

View File

@ -567,7 +567,8 @@ fn (c mut Checker) stmt(node ast.Stmt) {
sym.map_info().key_type
}
else {
table.int_type}
table.int_type
}
}
scope.override_var(ast.Var{
name: it.key_var
@ -581,7 +582,7 @@ fn (c mut Checker) stmt(node ast.Stmt) {
}
scope.override_var(ast.Var{
name: it.val_var
typ: c.table.value_type(typ)
typ: value_type
})
}
c.stmts(it.stmts)