How to resolve ambiguity when argument is null?

后端 未结 7 1560
轮回少年
轮回少年 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);
    

提交回复
热议问题