https://issues.dlang.org/show_bug.cgi?id=15832
--- Comment #3 from Atila Neves <atila.ne...@gmail.com> --- Ok, I've looked into it a bit more and I think it's a bug. I @disabled this(this) and it still happens. The worse part is the length of the slice seems to be garbage as well: this(ref T func) { _returns = [ReturnType!T.init]; ReturnType!T inner(ParameterTypeTuple!T values) { auto ret = _returns[0]; import std.conv: to; assert(_returns.length < 10, "Weird length: " ~ _returns.length.to!string); // the next line causes length to be incredibly large, i.e. gargabe if(_returns.length > 1) _returns = _returns[1..$]; return ret; } func = &inner; _scope = MockScope!(T)(func, &inner); } --