While attempting to compare two dlls for API changes, a co-worker noticed that some classes had two GetType() methods.
Upon deeper inspection, it turns out that System.Exception
shadows GetType():
// this method is required so Object.GetType is not made virtual by the compiler
public new Type GetType()
{
return base.GetType();
}
I see that System.Exception
implements _Exception, but I don't see a reason why GetType has to be explicitly shadowed as it wouldn't be virtual anyways.
So why does System.Exception shadow GetType()?