mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-30 19:41:15 -03:00
Fix error span for invalid slice indexes
The span now properly points at the token that was invalid, rather than the start of the slice. Also fix the span for `()[1]` and `()[d]`, which were previously reporting no source location at all.
This commit is contained in:
@@ -16,3 +16,15 @@ fish: show "$foo[2 1]"
|
||||
Array index out of bounds
|
||||
fish: show $foo[2 1]
|
||||
^
|
||||
Invalid index value
|
||||
fish: echo "$foo[d]"
|
||||
^
|
||||
Invalid index value
|
||||
fish: echo $foo[d]
|
||||
^
|
||||
Array index out of bounds
|
||||
fish: echo ()[1]
|
||||
^
|
||||
Invalid index value
|
||||
fish: echo ()[d]
|
||||
^
|
||||
|
||||
Reference in New Issue
Block a user