Virtual and Abstract Local Functions #7767
Replies: 3 comments 7 replies
-
I dislike this. Local functions don't exist outside of the scope in which they are defined. They aren't members to invoke within the current type, let alone derived types. This is a scenario already solved perfectly fine by defining proper |
Beta Was this translation helpful? Give feedback.
-
Also, the referenced discussions are about overloading, not overriding. |
Beta Was this translation helpful? Give feedback.
-
I'm not seeing a motivating scenario here. Could that be added? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello. I would like to broach for discussion a hopefully beneficial idea for the C# programming language. I propose that local functions could be
virtual
orabstract
.Some syntax ideas are presented, in these regards. In particular, a syntax idea is presented towards being able to express the overriding of a method's local function.
Above, the method
Invoke
provides developers with a type of contract with respect to its functionality while allowing some or all of its steps to be overridden, e.g.,StepTwo
.In the event of interest, I could write up a more detailed explainer on these ideas.
Any thoughts on these ideas? Thank you!
Beta Was this translation helpful? Give feedback.
All reactions