【发布时间】:2010-10-28 14:52:33
【问题描述】:
编译以下代码将返回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)
{
}
【问题讨论】:
-
哦,抱歉,看来我可以了 :)
标签: c# null ambiguous-call