More specifically, I've re-implemented the C# compiler's logic to decide whether or not you can attempt a cast ;-)