| 1 | vlib/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 | } |
| 8 | Details: |
| 9 | match condition type: int |
| 10 | range type: rune |
| 11 | vlib/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 | } |
| 18 | Details: |
| 19 | low part type: string |
| 20 | high part type: int literal |
| 21 | vlib/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 | } |
| 28 | Details: |
| 29 | match condition type: int |
| 30 | range type: string |
| 31 | vlib/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 | |