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?

O.

module AliasThis;

import S;
import K;

void foo(S s)
{
        //...
}

void main()
{  
        const K k;
        foo(k);
}
module S;

struct S
{
        int x;
}
module K;

import S;

struct K
{
         S s;
        public alias s this;
}

Reply via email to