digitalmars.D.bugs - DMD 0.95 bug: template references to alias in argument's namespace
- Burton Radons (14/14) Jul 17 2004 This code doesn't compile properly. The first line in classTemplate
- Andrew Edwards (4/21) Jul 17 2004 not sure but shouldn't it be:
- Burton Radons (5/25) Jul 18 2004 If I understand it correctly, using alias only loosens restrictions on
- Walter (1/1) Jul 20 2004 It is a bug, and a fix for it will be in the next update. -Walter
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: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.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!
Jul 18 2004
It is a bug, and a fix for it will be in the next update. -Walter
Jul 20 2004