zsh-workers
 help / color / mirror / code / Atom feed
From: Stephane Chazelas <stephane.chazelas@gmail.com>
To: Aryn Starr <whereislelouch@icloud.com>
Cc: zsh-workers@zsh.org
Subject: Re: Bug Report: Variable becomes unset without reason
Date: Wed, 14 Aug 2019 10:37:48 +0100	[thread overview]
Message-ID: <20190814093748.u3pkdzrixmtunnt7@chaz.gmail.com> (raw)
In-Reply-To: <2154283D-97B8-436B-8CC5-40624C11F356@icloud.com>

2019-08-08 20:38:05 +0430, Aryn Starr:
> I have included the file that reproduces the bug with `zsh -f` and the result of running it in https://gist.github.com/NightMachinary/32689e786a3b7f5865a042d49b884b57 <https://gist.github.com/NightMachinary/32689e786a3b7f5865a042d49b884b57>. 

  Please try and make sure your bug reports are self-contained.
  The zsh ML has been around for decades and along with its
  archives will probably be around for several more decades, but
  we can't tell much about github (that link may become invalid
  at any time).

  We should also not have to fire up a web browser to figure out
  what the bug is about.

Now, that being said, as discussed on U&L it looks like a bug
indeed and a shorter reproducer is:

$ zsh -xc 'v=1; f() { local v; v=2 true; }; f; typeset -p v'
+zsh:1> v=1
+zsh:1> f
+f:0> local v
+f:0> v=2 +f:0> true
+zsh:1> typeset -p v
zsh:typeset:1: no such variable: v

Most likely, that's the "v=2 true" (where "true" is a builtin) that ends up
unsetting the "v" from the global scope.

-- 
Stephane

  reply	other threads:[~2019-08-14  9:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-08 16:08 Aryn Starr
2019-08-14  9:37 ` Stephane Chazelas [this message]
2019-08-14 12:17   ` Aryn Starr
2019-08-14 14:04   ` Peter Stephenson
2019-08-14 15:12     ` Mikael Magnusson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190814093748.u3pkdzrixmtunnt7@chaz.gmail.com \
    --to=stephane.chazelas@gmail.com \
    --cc=whereislelouch@icloud.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).