rbwhitaker / CSharpPlayersGuideEarlyAccess

A place to track issues with the C# Player's Guide for patches and future editions
19 stars 0 forks source link

Auto-property `field` access #644

Open rbwhitaker opened 2 years ago

rbwhitaker commented 2 years ago

This is a feature meant to bridge the gap between auto-properties and full properties a little better.

The idea is that you can use the field keyword within a property getter or setter to refer to the automatically generated backing field. This allows you to do a tiny bit of validation or extra work that an auto-property can't automatically do (before) without having to necessarily go all the way to full properties.

rbwhitaker commented 1 year ago

At this point, I'm fairly convinced this feature did not and will not make it into C# 11. So I'm kicking this one out of the 6.0.0 milestone. It does look like it will get finished up and included in the next release of C#.