Skip to content

fix(interpreter): ${v@a} prints every attribute letter - #2626

Merged
chaliy merged 1 commit into
mainfrom
claude/attr-transform
Oct 8, 2026
Merged

chaliy merged 1 commit into
mainfrom
claude/attr-transform

Conversation

@chaliy

@chaliy chaliy commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Requested by Михайло · project thread

What changed

${v@a} now prints the same attribute letters declare -p shows, in bash's order: a/A, i, n, r, x, l, u. It follows namerefs to their target, a subscript (${f[k]@a}) reports the array, and ${arr[@]@a} repeats the letters once per element.

Why

Bash-oracle gap param-transform-ops. The transform only knew r and x, so integer and array variables reported nothing, which breaks scripts that branch on [[ ${v@a} == *a* ]].

Before / After

$ declare -i n=3; declare -alr b=(X); g=(1 2)
$ echo "${n@a}|${b@a}|${g[@]@a}"
before: ||
after:  i|arl|a a        (bash 5.2: i|arl|a a)

New spec param-attr-transform.test.sh (4 cases, checked against bash 5.2 and by bash_comparison_tests).

Risk

Low; only the @a operator changes. -t and -c are not modeled as attributes, so they still print nothing.

Checklist

  • fmt, clippy -D warnings
  • integration tests, bash_comparison_tests
  • knowledge/log.md

Generated by Claude Code

Reuses declare -p's attribute letters, follows namerefs, and repeats per
element for ${arr[@]@A}. It only knew r and x.
@chaliy chaliy self-assigned this Oct 8, 2026
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bashkit 10186d5 Commit Preview URL

Branch Preview URL
Oct 08 2026, 02:01 AM

@chaliy
chaliy merged commit baf8732 into main Oct 8, 2026
46 checks passed
@chaliy
chaliy deleted the claude/attr-transform branch October 8, 2026 02:58
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.

1 participant