Should an interface-based method invoke that uses “dynamic” still obey C# method resolution rules?

前端 未结 1 466
慢半拍i
慢半拍i 2020-12-09 04:36

As I understand it, each language can have it\'s own dynamic handler, so that the appropriate rules are applied. I\'m unsure if the following is correct/incorre

1条回答
  •  醉梦人生
    2020-12-09 05:18

    This is a well known limitation of the binder, asked about several times at SO and the subject of this feedback article. I'll quote Microsoft's answer:

    This was an area we explicitly scoped out due to time when shipping C# 4.0 and we'd love to revisit this. This specific case of ISet/IList methods that are actually defined on ICollection is the most visible place where not digging up through parent interfaces unnecessarily limits the reach of dynamic binding in C#.

    We hope to add such support soon, though this issue currently falls just below our bug triage cut line. We're marking the issue Won't Fix to indicate that we're not currently tracking to fix this issue in the next release of Visual Studio. We'll reactivate this bug over the next year if we get further than expected through our bug triage list, or if we revisit the bug for the following release.

    Which didn't happen yet, afaik. The article doesn't have a lot of votes.

    0 讨论(0)
提交回复
热议问题