https://issues.dlang.org/show_bug.cgi?id=15832
--- Comment #5 from Atila Neves <atila.ne...@gmail.com> --- At least there's a workaround: auto m = Mock!T(...); return m; I believe that the fact that this behaviour is different from the original implementation is a compiler bug and would ask for this to reopened. Also, the memory corruption that resulted from my original implementation goes well beyong a delegate referencing gargabe. It was really weird. Atila --