Thread overview
DMD 0.95 bug: template references to alias in argument's namespace don't work
Jul 17, 2004
Burton Radons
Jul 17, 2004
Andrew Edwards
Jul 18, 2004
Burton Radons
Jul 20, 2004
Walter
July 17, 2004
This code doesn't compile properly.  The first line in classTemplate works, but the second reports the error "no property 'type' for type 'classBase'".  It should create a field of the given alias type.

    class classBase
    {
        alias int type;
        const int constant = 1;
    }

    class classTemplate (parameter)
    {
        int value = parameter.constant;
        parameter.type field;
    }

    alias classTemplate! (classBase) instantiation;
July 17, 2004
Burton Radons wrote:

> This code doesn't compile properly.  The first line in classTemplate works, but the second reports the error "no property 'type' for type 'classBase'".  It should create a field of the given alias type.
> 
>     class classBase
>     {
>         alias int type;
>         const int constant = 1;
>     }
> 
>     class classTemplate (parameter)

not sure but shouldn't it be:

class classTemplate (alias parameter)

instead? Compiles fine with this change!

>     {
>         int value = parameter.constant;
>         parameter.type field;
>     }
> 
>     alias classTemplate! (classBase) instantiation;
July 18, 2004
Andrew Edwards wrote:

> Burton Radons wrote:
> 
>> This code doesn't compile properly.  The first line in classTemplate works, but the second reports the error "no property 'type' for type 'classBase'".  It should create a field of the given alias type.
>>
>>     class classBase
>>     {
>>         alias int type;
>>         const int constant = 1;
>>     }
>>
>>     class classTemplate (parameter)
> 
> 
> not sure but shouldn't it be:
> 
> class classTemplate (alias parameter)
> 
> instead? Compiles fine with this change!

If I understand it correctly, using alias only loosens restrictions on the types of symbols you can pass for the argument.  So that only shows that the bug doesn't exist for alias arguments, and that it remains for non-alias.
July 20, 2004
It is a bug, and a fix for it will be in the next update. -Walter