Thoughts about private aliases now working

Martin Nowak dawg at dawgfoto.de
Wed Feb 1 17:14:06 PST 2012


On Thu, 02 Feb 2012 01:55:11 +0100, Vladimir Panteleev  
<vladimir at thecybershadow.net> wrote:

> On Wednesday, 1 February 2012 at 23:14:47 UTC, Robert Clipsham wrote:
>> Are there any other options I'm missing?
>
You need to put it in the mixin as you do with imports.

mixin template Func()
{
     private alias string[string] SS;
     SS someFunc(SS s)
     {
         return s;
     }
}

> How about this:
>
>> a.d
>> ----
>> private alias string[string] SS;
>> mixin template Func()
>> {
>
>       private alias a.SS SS;
You are still accessing a.SS from b so this won't work. It's a compiler  
bug and is fixed here
https://github.com/D-Programming-Language/dmd/pull/669.


More information about the Digitalmars-d mailing list