Skip to content

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

Merged
andychu merged 1 commit into
oils-for-unix:masterfrom
akinomyoga:fix-prefixed-varname-expansion-for-second-time
Mar 15, 2020
Merged

andychu merged 1 commit into
oils-for-unix:masterfrom
akinomyoga:fix-prefixed-varname-expansion-for-second-time

Conversation

@akinomyoga

Copy link
Copy Markdown
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

andychu commented Mar 15, 2020

Copy link
Copy Markdown
Contributor

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