Pom*_*oma 25 c# null ambiguous-call
编译以下代码将返回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)
{
}
Run Code Online (Sandbox Code Playgroud)
Dis*_*ile 12
您还可以使用变量:
Class1 x = null;
Func(x);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3842 次 |
| 最近记录: |