Skip to content
New issue

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? Sign in to your account

[word_eval] Fix the ${!prefix@} failure for the second time #657

Conversation

akinomyoga
Copy link
Collaborator

See the fourth item in #653 (comment).

See the following test case. Even though it succeeds for the first time, it fails for the second time.

test3.sh

#!/usr/bin/env bash

abc_hello=1
function hello1 { echo "${!abc_@}"; }
hello1
hello1
$ osh test3.sh
abc_hello
  function hello1 { echo "${!abc_@}"; }
                             ^~~~
test3.sh:4: fatal: Bad indirect expansion: ''

@andychu
Copy link
Contributor

andychu commented Mar 15, 2020

Wow this is embarrassing -- the perils of test-driven development with narrow tests! :-/

I remember I filed #604 at this time because I found the code confusing.

Note to self: don't mutate the AST! Thank you.

@andychu andychu merged commit 3a18432 into oils-for-unix:master Mar 15, 2020
@akinomyoga akinomyoga deleted the fix-prefixed-varname-expansion-for-second-time branch March 15, 2020 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants