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

checker: check error for match mut with immutable variable (fix #9704 #8976) (#13725)

This commit is contained in:
yuyi
2022-03-13 15:53:29 +08:00
committed by GitHub
parent 83762fa4a4
commit 27f9bc9ba0
24 changed files with 82 additions and 50 deletions

View File

@@ -401,7 +401,7 @@ pub fn (mut t Transformer) expr_stmt_match_expr(mut node ast.MatchExpr) ast.Expr
for mut expr in branch.exprs {
expr = t.expr(mut expr)
match mut cond {
match cond {
ast.BoolLiteral {
if expr is ast.BoolLiteral {
if cond.val == (expr as ast.BoolLiteral).val {