Thread overview | ||||||
---|---|---|---|---|---|---|
|
July 17, 2004 DMD 0.95 bug: template references to alias in argument's namespace don't work | ||||
---|---|---|---|---|
| ||||
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 Re: DMD 0.95 bug: template references to alias in argument's namespace don't work | ||||
---|---|---|---|---|
| ||||
Posted in reply to Burton Radons | 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 Re: DMD 0.95 bug: template references to alias in argument's namespace don't work | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrew Edwards | 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 Re: DMD 0.95 bug: template references to alias in argument's namespace don't work | ||||
---|---|---|---|---|
| ||||
Posted in reply to Burton Radons | It is a bug, and a fix for it will be in the next update. -Walter |
Copyright © 1999-2021 by the D Language Foundation