bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Variable with the same name can't be declared in the local scope if


From: Lawrence Velázquez
Subject: Re: Variable with the same name can't be declared in the local scope if the global one is declared read-only
Date: Sun, 15 Nov 2020 05:40:32 -0500

Hi,

> On Nov 15, 2020, at 4:20 AM, 林博仁Buo-ren, Lin <buo.ren.lin@gmail.com> wrote:
> 
>       ## Current behavior
> 
>       ```
>       $ LANG=C ./depict-the-variable-shadowing-phenomenon.bash
>       ./depict-the-variable-shadowing-phenomenon.bash: line 11:
> local: variable_shadowed: readonly variable
>       ```
> 
> Repeat-By:
>       Refer the "Descripton" section.
> 
> Fix:
>       I suggest that bash shouldn't trigger the error, if the
> variable to be set is a `different` variable
>       instantiated by the variable shadowing mechanism.
> 

This behavior has been discussed previously and is not considered a bug, as far 
as I can tell.

https://lists.gnu.org/archive/html/bug-bash/2019-03/msg00150.html

https://lists.gnu.org/archive/html/bug-bash/2020-04/msg00200.html

vq
Sent from my iPhone

reply via email to

[Prev in Thread] Current Thread [Next in Thread]