Skip to content

fix(interpreter): resolve nameref for ${!ref[@]} key enumeration#855

Merged
chaliy merged 2 commits intomainfrom
fix/issue-846-nameref-key-enum
Mar 27, 2026
Merged

fix(interpreter): resolve nameref for ${!ref[@]} key enumeration#855
chaliy merged 2 commits intomainfrom
fix/issue-846-nameref-key-enum

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Mar 26, 2026

Summary

  • ${!ref[@]} now correctly returns keys when ref is a nameref to an associative array
  • The ArrayIndices handler in expand_word_to_string was not resolving namerefs before looking up keys
  • The expand_word_to_fields path already had the fix; this aligns the string expansion path

Test plan

  • nameref_assoc_key_enumeration_string — verifies ${!ref[@]} returns keys through nameref
  • Full spec test suite green
  • Clippy clean

Closes #846

chaliy added 2 commits March 26, 2026 23:42
Associative array key order is non-deterministic; sort output to
avoid flaky CI failures.
@chaliy chaliy merged commit 8191b3b into main Mar 27, 2026
23 checks passed
@chaliy chaliy deleted the fix/issue-846-nameref-key-enum branch March 27, 2026 00:04
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.

bug: ${!ref[@]} key enumeration empty when ref is nameref to associative array

1 participant