www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - alias foo foo - assert in compiler

reply "Ilya Zaitseff" <sark7 mail333.com> writes:
[aliasbug.d]

void foo() {};

void main()
{
   alias foo foo;
}

produces [dmd 0.96]:

aliasbug.d(5): alias foo recursive alias declaration
Assertion failure: 's != this' on line 267 in file 'declaration.c'

abnormal program termination
Jul 25 2004
parent "Ilya Zaitseff" <sark7 mail333.com> writes:
 [aliasbug.d]

 void foo() {};

 void main()
 {
    alias foo foo;
 }

 produces [dmd 0.96]:

 aliasbug.d(5): alias foo recursive alias declaration
 Assertion failure: 's != this' on line 267 in file 'declaration.c'

 abnormal program termination

I just discovered another bug with aliases... template T() { void foo() { return 0; } alias foo foo; } mixin T; void main() { foo(); } Compiler [0.97] goes into endless loop and does not respond.
Jul 28 2004