Reporter | William Dean (willdean) |
---|---|
Created | Jun 17, 2011 10:56:09 PM |
Updated | Apr 13, 2018 5:48:10 PM |
Resolved | Apr 13, 2018 5:48:10 PM |
Subsystem | Quick Fixes |
Assignee | Alisa Afonina (alisa.afonina) |
Priority | Major |
State | Obsolete |
Type | Usability Problem |
Fix version | Backlog |
Affected versions | No Affected versions |
Fixed In Version ReSharper | Undefined |
VsVersion | All Versions |
There are two quickfixes that can add a set accessor to a read-only property.
One you get to with 'alt-enter' on the property definition within the class. That's a good quick fix, which intelligently completes the 'set' clause, including some very clever stuff if you have to get to a secondary object (_field.Value). This is 'Add another accessor'
The other qf is when you assign something to a read-only property and then do 'alt-enter' on the red-squiggled property name. This is 'Create set accessor'. It's lame, and just creates a 'throw new NotImplementedException()' placeholder.
Given that R# has two ways of generating a set accessor, a clever one and a stupid one, it should always use the clever one.