Skip to content

fix(interpreter): splat "${arr[@]}" elements individually in array assignment#1052

Merged
chaliy merged 3 commits intomainfrom
fix/issue-963-array-splat
Apr 4, 2026
Merged

fix(interpreter): splat "${arr[@]}" elements individually in array assignment#1052
chaliy merged 3 commits intomainfrom
fix/issue-963-array-splat

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Apr 3, 2026

Summary

  • Fix "${arr[@]}" in array assignment producing one joined element instead of individual elements
  • Added detection for quoted "${arr[@]}" and "$@" patterns in array context to route through expand_word_to_fields
  • combined=("${arr1[@]}" "${arr2[@]}") now correctly produces N+M elements

Test plan

  • array_concat_at_expansion — two arrays concat to correct element count
  • array_splat_single_source — single "${orig[@]}" copy preserves elements
  • All existing array and bash spec tests pass

Closes #963

@chaliy chaliy merged commit 0a1daef into main Apr 4, 2026
27 checks passed
@chaliy chaliy deleted the fix/issue-963-array-splat branch April 4, 2026 01:15
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.

"${arr[@]}" in array assignment does not splat elements individually

1 participant