[Issue 11826] An Access Violation in Phobos with cartesianProduct at compile-time

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Aug 9 10:12:37 PDT 2014


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

--- Comment #4 from hsteoh at quickfur.ath.cx ---
Actually, the parameter to f() doesn't have to be an array:
------
struct S(alias fun)
{
    auto g() { return fun(0); }
}
auto f(int arr)
{
    return S!(a => arr)();
}
auto r = f(2);
void main() {
    r.g();
}
------

This seems to prove conclusively that the problem is caused by the lambda
trying to access the out-of-scope stack frame of f().

--


More information about the Digitalmars-d-bugs mailing list