digitalmars.D.bugs - DMD 0.95 bug: template references to alias in argument's namespace
- Burton Radons <burton-radons shaw.ca> Jul 17 2004
- Andrew Edwards <ridimz_at yahoo.dot.com> Jul 17 2004
- Burton Radons <burton-radons shaw.ca> Jul 18 2004
- "Walter" <newshound digitalmars.com> Jul 20 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;
Jul 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;
Jul 17 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.
Jul 18 2004
It is a bug, and a fix for it will be in the next update. -Walter
Jul 20 2004









Burton Radons <burton-radons shaw.ca> 