Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
to your account
for a,b in y 1 z 3; echo $a,$b; end
Expected result: either an error or (ideally) setting a=y b=1, iterating once, then setting a=z b=3; printing each of those pairs on its own line.
Actual result: 4 blank lines
Proof of what is actually happening:
for a,b in y 1 z 3; set -l; end
In other words, for is assigning to a variable named "a,b".
This variable cannot be expanded (echo $a,b expands correctly to nothing ($a is not set, and therefore the product of it with ",b" is nothing)), nor can the user set, query, or erase this variable.
fish version 3.0.2-824-gbf40f84b0
The text was updated successfully, but these errors were encountered:
List of invalid characters that for accepts in a variable name:
So, basically all of them, and in any position (for example for , in 1 2 3; set -l;end)
for , in 1 2 3; set -l;end
Sorry, something went wrong.
Yeah, that's a bug. It actually is created, too, neat:
$ for a,b in a;
$ for a,j in i v; echo foo; end
fish: invalid var name: a,j
for a,j in i v; echo foo; end
use standard warning for invalid variable in for loop
Work on #5800.
tests: add test for invalid variable name in for loop
No branches or pull requests