[Issue 16123] alias member of member
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Mon Jun 6 11:22:47 PDT 2016
https://issues.dlang.org/show_bug.cgi?id=16123
--- Comment #6 from Steven Schveighoffer <schveiguy at yahoo.com> ---
(In reply to Max Samukha from comment #5)
> (In reply to Steven Schveighoffer from comment #4)
> > I'm having trouble seeing how this logically is different. Access to t.s.x
> > is done by adding some offset to &t, just like access to s.x is done by
> > adding some offset to &s.
> >
> > I get that the "symbol" I'm trying to alias is really a compound symbol, but
> > I can alias it just fine in other places.
>
> I just say that what you are trying is not how 'alias' works, and the
> current semantics does make sense. Whether it is good is a different issue.
I would understand if s was a property and not a field, because you need to
execute code to compute the actual access. I get that alias is not as powerful
as a mixin, but this doesn't seem like a reasonable limitation.
Note: it's kind of weird that the compiler would allow this kind of alias to
compile when it's fully unusable.
> > This reminds me of the whole inability to alias keywords. It's an
> > implementation detail that I shouldn't have to care about!
>
> Inability to alias keywords is a different issue.
To the user, it's not much different. Granted, two different implementation
issues, but it looks the same -- compiler cannot do what should be obviously
doable.
--
More information about the Digitalmars-d-bugs
mailing list