mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
checker: improve the wording of the mismatched range types
error
This commit is contained in:
parent
bd3c9e888d
commit
d67aa8d76c
@ -174,7 +174,7 @@ fn (mut c Checker) match_exprs(mut node ast.MatchExpr, cond_type_sym ast.TypeSym
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
typ := c.table.type_to_str(c.expr(node.cond))
|
typ := c.table.type_to_str(c.expr(node.cond))
|
||||||
c.error('mismatched range types - trying to match `$node.cond`, which has type `$typ`, to a range of `rune`',
|
c.error('mismatched range types - trying to match `$node.cond`, which has type `$typ`, against a range of `rune`',
|
||||||
low_expr.pos)
|
low_expr.pos)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
vlib/v/checker/tests/match_range_mismatch_type_err.vv:4:3: error: mismatched range types - trying to match `x`, which has type `string`, to a range of `rune`
|
vlib/v/checker/tests/match_range_mismatch_type_err.vv:4:3: error: mismatched range types - trying to match `x`, which has type `string`, against a range of `rune`
|
||||||
2 | x := '1'
|
2 | x := '1'
|
||||||
3 | match x {
|
3 | match x {
|
||||||
4 | `0`...`9` {
|
4 | `0`...`9` {
|
||||||
|
Loading…
Reference in New Issue
Block a user