Does alias prevent hijacking?

Kagamin spam at here.lot
Sun May 29 23:53:20 PDT 2011


class Base
{
  void foo(string s){}
}

class Derived: Base
{
  alias Base.foo foo;
  void foo(long s){}
}

So far so good.

Now add new method to the Base class.

class Base
{
  void foo(string s){}
  void foo(int s){}
}

Now behavior of the calling code silently changes.


More information about the Digitalmars-d mailing list