accidentally at work I wrote the following line of code:
string x = (object) null;
// It was var x = (object)null and I changed from var to string instead of
// object x = null;
This gave me a compilation error similar to this: Can't cast source type object to target type string
Why? Isn't null
just a bunch of zeros pointing to "nowhere" memory address, no matter what the type is?