On 10/12/17 13:44, Jonathan M Davis wrote:
it sounds like the delegate that's
being generated isn't @nogc, so it can't be called within the function,
which would be a completely different issue from allocating a closure.
Here's the thing, though. There is no reason for the delegate to be
called at all!
Since func1's msg is also lazy, I expected the lowering to look like this:
void func1(/*scope*/ string delegate() msg) @nogc {
}
void func2(/*scope*/ string delegate() msg) @nogc {
func1(msg);
}
Even with scope commented out, the above compiles just fine. The fact
that msg is not @nogc doesn't matter at all, simply because no one is
evaluating the delegate.