If I create class A, and class B inherits from class A, why does C# require me to explicitly cast between them?
For example:
public class Mammal
{
}
public class Dog : Mammal
{
}
...
Mammal foo = new Dog(); // Invalid, wants an explicit cast
Mammal bar = (Mammal)new Dog(); // This one works
I'm just curious what the reasoning is behind that restriction.