diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index 54bcffd2dd..f4ac07ed73 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -153,6 +153,14 @@ pub fn (c mut Checker) infix_expr(infix_expr ast.InfixExpr) table.Type { } fn (c mut Checker) check_assign_expr(assign_expr ast.AssignExpr) { + match assign_expr.left { + ast.Ident { + if it.kind == .blank_ident { + return + } + } + else {} + } left_type := c.expr(assign_expr.left) c.expected_type = left_type // t := c.table.get_type_symbol(left_type) diff --git a/vlib/v/parser/parser.v b/vlib/v/parser/parser.v index a7d6bf4b87..78a3df1887 100644 --- a/vlib/v/parser/parser.v +++ b/vlib/v/parser/parser.v @@ -1161,12 +1161,11 @@ fn (p mut Parser) if_expr() ast.Expr { is_or = true p.open_scope() var_name := p.check_name() - // p.table.register_var( p.check(.decl_assign) expr,typ := p.expr(0) p.scope.register_var(ast.VarDecl{ name: var_name - typ: typ + expr: expr }) cond = ast.IfGuardExpr{ var_name: var_name