about summary refs log tree commit diff
path: root/Test
diff options
context:
space:
mode:
authorBart Schaefer <schaefer@zsh.org>2023-09-05 18:04:09 -0700
committerBart Schaefer <schaefer@zsh.org>2023-09-05 18:04:09 -0700
commite3c2af216b1f77202ef5240179dabcf4aab66f91 (patch)
treeb78c5b8af9da519162f313aad3bd0623a136bc20 /Test
parentc0caef561323b91ea0c4aa101b564f92ab51b68d (diff)
downloadzsh-e3c2af216b1f77202ef5240179dabcf4aab66f91.tar.gz
zsh-e3c2af216b1f77202ef5240179dabcf4aab66f91.tar.xz
zsh-e3c2af216b1f77202ef5240179dabcf4aab66f91.zip
52115: permit repeated "private" declarations as long as types aren't changed
Diffstat (limited to 'Test')
-rw-r--r--Test/V10private.ztst17
1 files changed, 17 insertions, 0 deletions
diff --git a/Test/V10private.ztst b/Test/V10private.ztst
index b876f548d..d902cac56 100644
--- a/Test/V10private.ztst
+++ b/Test/V10private.ztst
@@ -384,6 +384,23 @@ F:Should we allow "public" namerefs to private parameters?
  }
 0:regression test for unset private
 
+ () {
+   private x=1
+   unset x
+   private x=2
+   print $x
+ }
+0:private may be called twice
+>2
+
+ () {
+   private x=1
+   private -a x
+   print $x
+ }
+1:private may not change parameter type
+?(anon):private:2: can't change type of private param: x
+
 %clean
 
   rm -r private.TMP