Skip to content

fix(interpreter): resolve namerefs before nounset check#839

Merged
chaliy merged 1 commit intomainfrom
fix/issue-834-nameref-nounset
Mar 26, 2026
Merged

fix(interpreter): resolve namerefs before nounset check#839
chaliy merged 1 commit intomainfrom
fix/issue-834-nameref-nounset

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Mar 26, 2026

Summary

  • Nameref variables are now followed to their target before checking if a variable is unbound under set -u
  • Previously, the nameref itself was checked, causing false "unbound variable" errors even when the target was defined

Test plan

  • nameref_nounset_basic — basic nameref under set -u
  • nameref_nounset_local_n — local -n inside function under nounset
  • nameref_nounset_array — nameref to array under nounset
  • nameref_nounset_write_through — nameref write-through under nounset
  • nameref_nounset_harness_pattern — set -euo pipefail with nameref function
  • All 1753 bash spec tests pass
  • No regressions

Closes #834

Nameref variables are now followed to their target before checking
if a variable is unbound under set -u. Previously, the nameref itself
was checked, causing false 'unbound variable' errors.

Closes #834
@chaliy chaliy merged commit e0370ba into main Mar 26, 2026
18 of 23 checks passed
@chaliy chaliy deleted the fix/issue-834-nameref-nounset branch March 26, 2026 17:22
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: nameref expansion fails under set -u (nounset)

1 participant