[Issue 7459] Document the workarounds for mutually-called nested functions.
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Wed Apr 23 05:18:27 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=7459
--- Comment #7 from Kenji Hara <k.hara.pg at gmail.com> ---
(In reply to timon.gehr from comment #0)
> d-programming-language.org/function sez:
>
> Unlike module level declarations, declarations within function scope are
> processed in order. This means that two nested functions cannot mutually
> call each other:
>
[snip]
>
> The proposed solution is unnecessarily complicated and non-optimal. Since
> nested template functions are instantiated with the state of the symbol
> table of the lexically first instantiation, this is a superior solution:
>
> void test() {
> void foo()() { bar(); } // ok
> void bar() { foo(); } // ok
> }
In issue 12578, I'm proposing a language behavior to accept the code.
--
More information about the Digitalmars-d-bugs
mailing list