我希望将相等操作传递给包装的实例。(lhs == rhs);} 这看起来很简单,但实际上它抛出了一个非常简单的null检查的异常: XmlWrapper wrapper = new XmlWrapper(someElement= nullWrapper) Console.WriteLine("Wrapper is not null"); //This line throws 这是因为相等运算符接收的一个参数为null<
在检查String ==操作符时,我注意到它调用了String.Equals(string a, string b),这意味着它只是一个传递。检查String.Equals(string a, string b)方法时,我看到它使用==操作符执行相等检查。当执行类似于StackOverflowException或"x" == "y"之类的操作时,这是如何工作的,而不会导致"x" == "x"
更新:我让Jet