www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - aliasing function inside class

This code:

/////////////////////////////////////
int foo (int a, int t) { return 0; }

class A
{
    void foo ( ) { }
    alias .foo foo;
}

void main ()
{
    with ( new A )
        int y = foo(0,1);
}
/////////////////////////////////////

Produces this when compiling: "Internal error: ..\ztc\cod1.c 2244".
If I remove the alias and make an explicit call ( int y = .foo(0,1) ), it
works.
If I remove void foo() from A, it works.

-----------------------
Carlos Santander Bernal
Jul 22 2004