alias this question

spir denis.spir at gmail.com
Sun Feb 13 11:09:28 PST 2011


On 02/13/2011 05:30 PM, Olli Aalto wrote:
> I encountered a problem with alias this, when the aliased member is private.
> I'm using the latest dmd2. It reports the follwing:
> src\main.d(14): Error: struct K.K member s is not accessible
>
> If I change the private modifier on the s member to public it works.
>
> Is this as intended, or a bug?

Dunno, lets me wonder: what are use cases of alias this on a public member? I 
mean, on a member that /must/ remain private. Then, it's just syntactic sugar, 
which is good, but why wrap it into an object?
In my mind, the typical use case is precisely a wrapper struct around something 
that, so-to-say, "naturally" ends up private.

Denis
-- 
_________________
vita es estrany
spir.wikidot.com



More information about the Digitalmars-d mailing list