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

v2: fix condition in AssignStmt

This commit is contained in:
Joe Conigliaro 2020-02-27 21:15:30 +11:00
parent 237d83b2ee
commit aba0bb5e01

View File

@ -1527,7 +1527,7 @@ pub fn (p mut Parser) assign_stmt() ast.AssignStmt {
expr,_ := p.expr(0) expr,_ := p.expr(0)
is_decl := op == .decl_assign is_decl := op == .decl_assign
for ident in idents { for ident in idents {
if is_decl && ident.kind == .blank_ident { if is_decl && ident.kind != .blank_ident {
if p.scope.known_var(ident.name) { if p.scope.known_var(ident.name) {
p.error('redefinition of `$ident.name`') p.error('redefinition of `$ident.name`')
} }