mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
checker: fix dumping match expr (#15869)
This commit is contained in:
parent
5cc9d7b347
commit
50fb5de926
@ -2179,6 +2179,7 @@ pub fn (mut c Checker) expr(node_ ast.Expr) ast.Type {
|
||||
return c.concat_expr(mut node)
|
||||
}
|
||||
ast.DumpExpr {
|
||||
c.expected_type = ast.string_type
|
||||
node.expr_type = c.expr(node.expr)
|
||||
c.check_expr_opt_call(node.expr, node.expr_type)
|
||||
etidx := node.expr_type.idx()
|
||||
|
1
vlib/v/tests/inout/dump_match_expr.out
Normal file
1
vlib/v/tests/inout/dump_match_expr.out
Normal file
@ -0,0 +1 @@
|
||||
[vlib/v/tests/inout/dump_match_expr.vv:3] ast.MatchExpr: 1
|
8
vlib/v/tests/inout/dump_match_expr.vv
Normal file
8
vlib/v/tests/inout/dump_match_expr.vv
Normal file
@ -0,0 +1,8 @@
|
||||
fn main() {
|
||||
i := 1
|
||||
dump(match i {
|
||||
0 { '0' }
|
||||
1 { '1' }
|
||||
else { '2' }
|
||||
})
|
||||
}
|
Loading…
Reference in New Issue
Block a user