Skip to content

${assoc[*]@A} drops the assignment body (prints only the name; GNU prints declare -A assoc=(...) as one word) #371

Closed

Description

@caomengxuan666

Found by ecosweep4-B triage lane (wt23/bats364, 2026-10-01). One of the 3 parameter_transform_tests reds.

Reproducer (GNU oracle: WSL GNU Bash 5.3.0 script-file run)

declare -A assoc; assoc[one]=alpha; assoc[two]=beta
printf '<%s>\n' "${assoc[*]@A}"
  • GNU 5.3.0: <declare -A assoc=([two]="beta" [one]="alpha" )> — ONE word (assoc key order is hash order, do not pin it).
  • rubash (2e6b0e9): <declare>\n<-A>\n<assoc> — the transform result field-splits AND the =(...) body is lost entirely.

Owner: parameter transform @A (subst.c parameter_brace_expand / transform ops, builtins/... @A operator = "declare form"). The indexed twin ${arr[*]@A} in the same test file passes.

The other two reds in the suite (expands_prompt_escapes, prints_key_value_pairs) are in the same family and should be re-run after this fix.

Artifacts: probe script target/assoc-A.sh (lane worktree).

Activity

  1. added
    bug
    on Oct 1, 2026
  2. added 3 commits that reference this issue on Oct 1, 2026
  3. caomengxuan666 commented on Oct 1, 2026

    @caomengxuan666
    MemberAuthor

    Landed as 27ffceb (wt25/semix lane commit 055df19b). Two roots: (1) element assignment now clears DECLARED_UNSET_VARS (GNU arrayfunc.c:815 assign_array_element allocates a real cell, so subst.c:8690-8697 array_var_assignment renders the body); (2) word splitting follows chk_atstar (subst.c:7642-7649) — quoted [*] is one word, quoted [@] splits only the bare prefix on current IFS (setifs subst.c:12322, empty-IFS single-space fallback subst.c:12134) with the value body CTLESC-carried intact (subst.c:8703). Full transform matrix byte-identical to WSL GNU 5.3.0; issue371 suite 9/9; parameter_transform_tests stale expectations updated to GNU-probed values. CI green on 50cd08c.

  4. added a commit that references this issue on Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions