How do i cast A to object to class A when B can typcast to A?
- by acidzombie24
Basically i want to do this. ee causes a bad cast exception.
NOTE: o can be ANYTHING. It may not be B, it can be C, D, E, F etc. But this should work as long as o is a class that can typecast into A (B is such a class. It uses an implicit operator overload)
var b = (B)"sz";
var e = (A)b;
object o = b;
var ee = (A)o;