https://issues.dlang.org/show_bug.cgi?id=23112

--- Comment #2 from Walter Bright <bugzi...@digitalmars.com> ---
(In reply to Dennis from comment #1)
>     auto call()() 

Rewriting as:

>     auto call()

and it gives the error:

test2.d(8): Error: function `test2.bar` is `@nogc` yet allocates closures with
the GC
test2.d(10):        test2.bar.f closes over variable a at test2.d(8)

which is what we expect. The trouble with the template version is the
semantic3() of bar() should run the semantic3() of Forward.call, which is
necessary to discover that bar() requires a closure. But it does not do the
semantic3() of Forward.call until after semantic3() for bar() has completed.

--

Reply via email to