https://issues.dlang.org/show_bug.cgi?id=24838
Richard (Rikki) Andrew Cattermole <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |[email protected] Resolution|--- |WONTFIX --- Comment #1 from Richard (Rikki) Andrew Cattermole <[email protected]> --- This is a misunderstanding of what ``@nogc`` is. It is a linting tool. It guarantees that no GC allocation will take place within the function. The reason why the compiler is not putting the closure on the stack is because it could escape the call stack. Mark the delegate parameter in ``acceptsCallback`` as ``scope`` and this will work. Without the escaping guarantees, using the GC is the correct solution in this situation, and therefore should error. --
