" <method1> " 和 " <method2> " 的差异仅在于可选参数的默认值,因此它们无法重载对方'<method1>' and '<method2>' cannot overload each other because they differ only by the default values of optional parameters

已尝试使用与前者区别仅在于可选参数的另一种方法重载某种方法。You have attempted to overload a method with another method that differs from the first only in its optional parameters. 具有可选参数的方法相当于两个重载方法,其中一个有可选参数,而另一个没有。A method with an optional parameter is equivalent to two overloaded methods, one with the optional parameter, and the other without it. 因此,无法使用对应其中任一方法的参数列表来重载方法。Therefore, you cannot overload a method with an argument list corresponding to either of these.

错误 ID: BC30305Error ID: BC30305

更正此错误To correct this error

  • 确保对这些方法的区分不只局限于可选参数。Ensure that the methods are differentiated by more than only optional parameters.

另请参阅See also