Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Champion: "Allow Obsolete attribute on getters and setters" #2152
It would have to be decided whether it would be an error to obsolete all the accessors in a property, as the property should be obsoleted instead.
I would suggest for consistency the design should follow that of VB which already allows the obsolete attribute on getters and setters.
VB allows all accessors ina property to be declared obsolete. It also allows usages of nameof on a property where all accessors have been declared obsolete.
This also avoids needing to special case the obsolete attribute, as any other attribute which is valid on both methods and properties can be applied to all accessors of a property at once.
It looks like the LDC has supported this proposal.
A prototype exists at dotnet/roslyn#32571