We have to classes like this:
public class BaseClass
{
public void DoSomething()
{
Foo();
}
private void Foo()
{
}
}
public class DerivedClass : BaseClass
{
private void Foo()
{
}
}
When executing
DerivedClass d = new DerivedClass();
d.DoSomething();
we expect BaseClass.Foo() to be called from inside DoSomething(), but instead
DerivedClass.Foo() is called,
just as if BaseClass.Foo was declared virtual and DerivedClass.Foo() was
declared override.
The same happens when declaring Foo() slightly different (public and new)
public class BaseClass
{
public void DoSomething()
{
Foo();
}
public void Foo()
{
}
}
public class DerivedClass : BaseClass
{
private new void Foo()
{
}
}
Original issue reported on code.google.com by zoomer...@gmail.com on 11 Jul 2013 at 8:31
Original issue reported on code.google.com by
zoomer...@gmail.com
on 11 Jul 2013 at 8:31