Replies: 1 comment
-
This is by-design. Although this portion was not fully spelled out in the extensions spec yet, it falls out of existing rules for member lookup:
Your final scenario works because the property is an instance member and the method is an extension method, and instance members always come before extensions. This does not inform how instance members should resolve with other instance members, or how extension members should resolve with other extension members. Note: for completeness, although this was not in the examples you provided, there is scenario where the compiler deviates from the spec and allows methods and some other members to be resolved together (methods are given preference over non-methods). That is an implementation bug (documented spec deviation) and LDM decided not to carry it forward for extensions (ie. we're sticking to the spec). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Moving the extension property to a different container class does not change the error. IDE hover seems to usually show the property, but not always (though I can't reproduce when I saw it not doing so).
This is disallowed:
But this is allowed, and works as expected:
Version Used:
Beta Was this translation helpful? Give feedback.
All reactions