Skip to content

Don't treat out-of-bounds differently than undefined variables #826

@ghost

Description

set a b; echo $a[1] yields b, while set a b; echo $a[2] yields the error fish: Could not expand string “$a[2]”.

Meanwhile, echo $a[2] without setting anything simply yields an empty string. This seems kind of like an odd behaviour, and there's no reason that there should be an error if you go out of bounds on an array when there isn't one for undefined variables.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions