Tag: ambiguous call

如果参数为null,如何解决歧义?

编译以下代码将返回The call is ambiguous between the following methods or properties错误The call is ambiguous between the following methods or properties 。 如何解决它因为我无法将null显式转换为任何这些类? static void Main(string[] args) { Func(null); } void Func(Class1 a) { } void Func(Class2 b) { }