How to resolve ambiguity when argument is null?

后端 未结 7 1562
轮回少年
轮回少年 2021-01-03 19:36

Compiling the following code will return The call is ambiguous between the following methods or properties error. How to resolve it since I can\'t explicitly co

相关标签:
7条回答
  • 2021-01-03 20:35

    Using as for the casting makes it slightly more readable with the same functionality.

    Func(null as Class1);
    
    0 讨论(0)
提交回复
热议问题