[Pkg-zsh-devel] Bug#871787: Bug#871787: Bug#871787: zsh: error "defining function based on alias ..."

Daniel Shahaf danielsh at apache.org
Fri Aug 11 18:20:13 UTC 2017


Vincent Lefevre wrote on Fri, Aug 11, 2017 at 18:15:21 +0200:
> On 2017-08-11 17:17:36 +0200, Axel Beckert wrote:
> >   commit bb218704d27bcca9aa4426296dcd5c13d58b330a
> >   Author: Peter Stephenson <p.w.stephenson at ntlworld.com>
> >   Date:   Tue Jan 10 19:14:26 2017 +0000
> > 
> >     40306 with doc tweaks: Change behaviour expanding alias in ()
> >     function definition.
> >     
> >     Now an error unless the () is part of the same error as the name.
> >     Add ALIAS_FUNC_DEF option to allow it again.
> > 
> > So you should either add this option or change the syntax of your
> > startup scripts. I hence consider this to be a non-bug.
> 
> OK, but perhaps this should be announced then, since there are
> legitimate uses and this is a change in the behavior.

It is mentioned in the list of incompatibilities in the upstream README.

I suppose it could be added to NEWS.Debian.

> In my case, this is typically something like:
> 
> alias ssh='nocorrect ssh'
> 
> and a ssh wrapper is defined as a function. I don't see anything
> wrong with this kind of construct.

As the upstream README explains, the problem is that

    alias ssh='nocorrect ssh'
    ssh() { command ssh "$@" }

defines a function called 'nocorrect' whose body is { command ssh "$@" },
due to the MULTI_FUNC_DEF option.  That's the purpose of the warning, 
Is that what your code does?



More information about the Pkg-zsh-devel mailing list