Discussion: Overriding with expression bodies #8380
Labels
Area-IDE
Feature Request
Resolution-Fixed
The bug has been fixed and/or the requested behavior has been implemented
Milestone
Hi,
I am in the process of overriding couple of read-only properties that I would like to implement using simple expression bodies. However the autocomplete is pushing me hard into full bodies - I basically need to declare the property by typing each letter, dismissing any attempts to help. I wonder whether anything could be done in this regard?
I am not really sure what though... One obvious idea is to have a setting to use expression bodies whenever applicable when generating code, but I am not that big fan of that.
Another idea I had was the similar experience we had when adding handlers to the events - if possible, you will get an expression body implementation with a tooltip saying hit TAB (or enter for that matter) to get a full body instead. The problem with this one is that apparently throwing an exception is not a valid thing in an expression body, so the default implementation must be real. It could default to
default(type)
which would be selected like when generating event handlers, so that you can start typing over it. Since expression bodies are meant to by easy and short, that shouldn't be that much of issue.What do others think?
The text was updated successfully, but these errors were encountered: