[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 08:08:42 PDT 2017
https://issues.dlang.org/show_bug.cgi?id=17435
--- Comment #5 from ag0aep6g at gmail.com ---
(In reply to Vladimir Panteleev from comment #3)
> 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.
Makes sense.
> "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.
That sounds reasonable, but it needs a paragraph in the spec. Or is it in there
and I just can't find it?
If that kind of `static` gets (or is) defined in the spec, this issue could be
closed as invalid on the grounds that the "static" version is the correct way
to write the code.
--
More information about the Digitalmars-d-bugs
mailing list