vxx2 / vlib / v / checker / tests / const_expr_match_range_invalid_err.out
37 lines · 37 sloc · 1.29 KB · 1512486d01d4205e7b67ebd679238fa45cd348af
Raw
1vlib/v/checker/tests/const_expr_match_range_invalid_err.vv:6:2: error: the range type and the match condition type should match
2 4 |
3 5 | match 5 {
4 6 | start...`1` {
5 | ~~~~~~~~~~~
6 7 | println(start)
7 8 | }
8Details:
9match condition type: int
10 range type: rune
11vlib/v/checker/tests/const_expr_match_range_invalid_err.vv:9:2: error: the low and high parts of a range expression, should have matching types
12 7 | println(start)
13 8 | }
14 9 | 'str'...end {
15 | ~~~~~~~~~~~
16 10 | println(end)
17 11 | }
18Details:
19 low part type: string
20high part type: int literal
21vlib/v/checker/tests/const_expr_match_range_invalid_err.vv:9:2: error: the range type and the match condition type should match
22 7 | println(start)
23 8 | }
24 9 | 'str'...end {
25 | ~~~~~~~~~~~
26 10 | println(end)
27 11 | }
28Details:
29match condition type: int
30 range type: string
31vlib/v/checker/tests/const_expr_match_range_invalid_err.vv:9:2: error: match branch range expressions need the start value to be known at compile time (only enums, const or literals are supported)
32 7 | println(start)
33 8 | }
34 9 | 'str'...end {
35 | ~~~~~
36 10 | println(end)
37 11 | }
38