Skip to content

fix(interpreter): handle compound array assignment in local builtin#888

Merged
chaliy merged 1 commit intomainfrom
fix/issue-877-local-array-compound
Mar 28, 2026
Merged

fix(interpreter): handle compound array assignment in local builtin#888
chaliy merged 1 commit intomainfrom
fix/issue-877-local-array-compound

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Mar 27, 2026

Summary

  • local arr=(one two three) produced an empty array because compound assignment syntax =(...) was only recognized when -a or -A flags were present
  • Detect =(...) syntax regardless of flags in both function-scope and global-scope paths
  • Also handle global-scope local with compound assoc array assignments
  • Unskip nameref_local_dynamic_scope test that depended on this fix (22 skipped, down from 23)

Test plan

  • New spec tests local_array_compound_assignment and local_array_compound_in_global pass
  • Previously skipped nameref_local_dynamic_scope now passes
  • All 1812 bash spec tests pass (100%, 22 skipped)
  • Full cargo test --all-features passes
  • cargo fmt --check and cargo clippy clean

Closes #877

`local arr=(one two three)` produced an empty array because the compound
assignment syntax was only recognized when -a or -A flags were present.

Detect =(...)  syntax regardless of flags in both function-scope and
global-scope paths of execute_local_builtin. Also unskip
nameref_local_dynamic_scope test that depended on this fix.

Closes #877
@chaliy chaliy merged commit 2928e36 into main Mar 28, 2026
23 checks passed
@chaliy chaliy deleted the fix/issue-877-local-array-compound branch March 28, 2026 00:09
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.

local arr=(a b c) produces empty array

1 participant