How to resolve ambiguity when argument is null?

后端 未结 7 1571
轮回少年
轮回少年 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:23

    You should be able to cast null to either of those, the same as you would a variable Func((Class1)null).

提交回复
热议问题