The column highlight for the "repeated patterns" error points incorrectly to the first pattern in the line, which
causes confusion:
fn main() {
match 1u8 {
b'a' | b'b' | b'b' => {}
else => {}
}
}
This produces the repeated patterns error, but both highlights (error and hint) are on b'a'
, which is not the repeated. The repeated pattern is b'b'
.
Bad error message:
Error: Duplicated match pattern
βββββ¬β boog.jakt:4:10
26 β match 1u8 {
27 β b'a' | b'b' | b'b' => {}
β βββ¬
β β°β Duplicated match pattern
28 β else => {}
βββββ΄β
Hint: Original pattern here
βββββ¬β boog.jakt:4:10
26 β match 1u8 {
27 β b'a' | b'b' | b'b' => {}
β βββ¬
β β°β Original pattern here
28 β else => {}
βββββ΄β
Expected error message:
Error: Duplicated match pattern
ββββ¬β boog.jakt:4:23 | <- notice how the column number changes here. This should be the only thing to test, really.
3 β match 1u8 {
4 β b'a' | b'b' | b'b' => {}
β βββ¬ | notice how the offset in of the highlight is different, since it was moved
β β°β Duplicated match pattern |
5 β }
ββββ΄β
Hint: Original pattern here
ββββ¬β boog.jakt:4:10
3 β match 1u8 {
4 β b'a' | b'b' | b'b' => {}
β βββ¬ | I've also had to move the highlight here
β β°β Original pattern here
5 β }
ββββ΄β
Note that Jakttest currently doesn't support error message locations, only searching through their titles, so automating this test is not going to be pretty (if it is done) for the moment.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too