mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-17 16:11:15 -03:00
Emit an error message on literal zero indices
Mostly resolves #4862, though there remains the lingering question of whether or not to emit a warning to /dev/tty or stderr when a non-literal-zero index evaluates to zero.
This commit is contained in:
9
tests/zero_based_array.err
Normal file
9
tests/zero_based_array.err
Normal file
@@ -0,0 +1,9 @@
|
||||
fish: array indices start at 1, not 0.
|
||||
echo $foo[0]
|
||||
^
|
||||
fish: array indices start at 1, not 0.
|
||||
echo $foo[ 0 ]
|
||||
^
|
||||
fish: array indices start at 1, not 0.
|
||||
echo $foo[ 00 ]
|
||||
^
|
||||
Reference in New Issue
Block a user