diff options
| author | Bart Schaefer <schaefer@zsh.org> | 2025-05-12 21:29:16 -0700 |
|---|---|---|
| committer | Bart Schaefer <schaefer@zsh.org> | 2025-05-12 21:29:16 -0700 |
| commit | b0fa403a3da0f01cb75eeea701c652b007b5db1b (patch) | |
| tree | 76e399f6bb21f0570945ae44f651b978033bd7ad /Test | |
| parent | unposted: fix bad pointer found by valgrind (diff) | |
| download | zsh-b0fa403a3da0f01cb75eeea701c652b007b5db1b.tar zsh-b0fa403a3da0f01cb75eeea701c652b007b5db1b.tar.gz zsh-b0fa403a3da0f01cb75eeea701c652b007b5db1b.tar.bz2 zsh-b0fa403a3da0f01cb75eeea701c652b007b5db1b.tar.lz zsh-b0fa403a3da0f01cb75eeea701c652b007b5db1b.tar.xz zsh-b0fa403a3da0f01cb75eeea701c652b007b5db1b.tar.zst zsh-b0fa403a3da0f01cb75eeea701c652b007b5db1b.zip | |
53602: "typeset -nu" always refers to at a call level above the declaration
Diffstat (limited to 'Test')
| -rw-r--r-- | Test/K01nameref.ztst | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/Test/K01nameref.ztst b/Test/K01nameref.ztst index 30b6673e0..54f0aaf68 100644 --- a/Test/K01nameref.ztst +++ b/Test/K01nameref.ztst @@ -767,6 +767,18 @@ F:typeset cannot bypass a name in the local scope, even via nameref >typeset -a foo=( alpha beta gamma ) >typeset -g foo=3 + () { + # scope with no parameters + () { + local -nu upref=$1 + local var=at_upref + print -- $upref + } var + } +0:up-reference part 15, non-existent parameter in outer scope +# no output expected +> + if [[ $options[typesettounset] != on ]]; then ZTST_skip='Ignoring zmodload bug that resets TYPESET_TO_UNSET' setopt typesettounset @@ -1088,16 +1100,16 @@ F:previously this could create an infinite recursion and crash >h:1: rs= - ra= - rs1= - ra1= >h:2: rs= - ra= - rs1= - ra1= >i:1: rs= - ra= - rs1= - ra1= ->i:2: rs=h - ra=h - rs1=h - ra1=h ->j:1: rs=h - ra=h - rs1=h - ra1=h ->j:2: rs=h - ra=h - rs1=h - ra1=h ->i:3: rs=h - ra=h - rs1=h - ra1=h ->k:1: rs=h - ra=h - rs1=h - ra1=h ->k:2: rs=h - ra=h - rs1=h - ra1=h ->h:3: rs=h - ra=h - rs1=h - ra1=h ->k:1: rs=h - ra=h - rs1=h - ra1=h ->k:2: rs=h - ra=h - rs1=h - ra1=h ->g:3: rs=g - ra=g - rs1=g - ra1=g +>i:2: rs=g - ra=g - rs1=g - ra1=g +>j:1: rs=g - ra=g - rs1=g - ra1=g +>j:2: rs=g - ra=g - rs1=g - ra1=g +>i:3: rs=g - ra=g - rs1=g - ra1=g +>k:1: rs=g - ra=g - rs1=g - ra1=g +>k:2: rs=g - ra=g - rs1=g - ra1=g +>h:3: rs=g - ra=g - rs1=g - ra1=g +>k:1: rs=g - ra=g - rs1=g - ra1=g +>k:2: rs=g - ra=g - rs1=g - ra1=g +>g:3: rs=f - ra=f - rs1=f - ra1=f e '' 6 0:assignment at different scope than declaration, '' 6 |
