[Issue 17435] bogus "need 'this'" error with aggregate field passed in alias parameter
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Fri May 26 07:53:06 PDT 2017
https://issues.dlang.org/show_bug.cgi?id=17435
--- Comment #3 from Vladimir Panteleev <thecybershadow at gmail.com> ---
(In reply to ag0aep6g from comment #2)
> In the language, there's no such thing as a
> static module-level function/template that's distinct from a non-static
> module-level function/template, or is there?
If a template has an alias parameter, the template becomes nested inside the
same context as the alias argument's context. E.g. if the alias argument is a
local variable inside a function, the template becomes nested in that function,
i.e. acts as if it was declared inside the function's body. "static" here has
the same effect as on symbols inside function bodies or aggregate types: they
force the compiler to not create a context pointer.
I've discussed this topic at this DConf a bit.
Some additional links:
https://github.com/D-Programming-Language/dmd/pull/2794
https://github.com/D-Programming-Language/dmd/pull/3884
https://github.com/D-Programming-Language/dmd/pull/3345
https://issues.dlang.org/show_bug.cgi?id=11946
https://issues.dlang.org/show_bug.cgi?id=7805
https://github.com/CyberShadow/ae/blob/master/utils/meta/caps.d
--
More information about the Digitalmars-d-bugs
mailing list