[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [4.1.4]: nested indirect function calls diagnosed as error.
From: |
arnold |
Subject: |
Re: [4.1.4]: nested indirect function calls diagnosed as error. |
Date: |
Sat, 26 Mar 2022 13:34:46 -0600 |
User-agent: |
Heirloom mailx 12.5 7/5/10 |
Hello.
Thanks for the report. This is indeed a bug. The patch attached
to this email fixes it.
I will push it to Git a little later.
Thanks!
Arnold
Kaz Kylheku <kaz@kylheku.com> wrote:
> Hi!
>
> GNU Awk 4.1.4 in Ubuntu 18 diagnoses the indicated line in the following
> snippet.
>
> Does this reproduce in current?
>
> function okay(f1, f2, arg)
> {
> return @f1(arg)
> }
>
> function not_so_hot(f1, f2, arg)
> {
> return @f1(arg, @f2(arg)) # line 8: error here
> }
>
> function workaround(f1, f2, arg,
> tmp)
> {
> tmp = @f2(arg)
> return @f1(arg, tmp)
> }
>
> The diagnostic is:
>
> gawk: gawkbug.awk:8: error: attempt to use non-function `f1' in function
> call.
>
>
> Though such nesting isn't described in the manual, it more or less
> reasonably
> follows from the composition of expressions, including regular, direct
> function calls.
>
> Cheers ...
indirect-fix.diff
Description: Text document