Ambiguous method call with Action parameter overload

前端 未结 3 1828
时光说笑
时光说笑 2021-01-18 09:47

I encountered some unexpected compiler behaviour when calling overloaded method with different Action variations.

Let\'s say I have this class

3条回答
  •  清歌不尽
    2021-01-18 10:17

    This is due to an implicit casting between long and decimal.

    Here's a table of implicit castings(for simple types) in C#(Picture Source):

    enter image description here

    Read more about type conversions here.

提交回复
热议问题