Comment #0 by john.loughran.colvin — 2019-01-28T18:10:17Z
static struct S(alias f)
{
int foo() { return f(); }
}
void main()
{
int a;
int b = S!(() => a)().foo;
}
Error: function onlineapp.main.S!(delegate () => a).S.foo cannot access frame of function D main
Removing the `static` causes it to compile fine, but why does static do anything at module scope? I tried to read the docs but they didn't say much on the topic.
This was fixed in https://github.com/dlang/dmd/pull/2794 and then broken again in the revert https://github.com/dlang/dmd/pull/3884/
Comment #1 by robert.schadek — 2024-12-13T19:02:15Z