Reporter |
|
---|---|
Created | Mar 13, 2009 12:15:12 PM |
Updated | Apr 5, 2018 5:22:50 PM |
Resolved | Apr 5, 2018 5:22:50 PM |
Subsystem | Quick Fixes - Create From Usage |
Assignee | Alisa Afonina (alisa.afonina) |
Priority | Normal |
State | Obsolete |
Type | Bug |
Fix version | Backlog |
Affected versions | No Affected versions |
Fixed In Version ReSharper | Undefined |
VsVersion | All Versions |
When implementing a new property for a readonly field Resharper incorrectly generates a setter for the field.
f I need a new property in another class for Foo.Fee
If I then tell Resharper to use the '_fee' backing field on the generated property, Resharper creates the invalid setter for the field. I don't believe it should do that, but rather generate a readonly property instead?
public class Foo {
private readonly int _fee;
}
f I need a new property in another class for Foo.Fee
var theFee = fooInstance.Fee; // Tell Resharper to "Create property 'Fee'"
If I then tell Resharper to use the '_fee' backing field on the generated property, Resharper creates the invalid setter for the field. I don't believe it should do that, but rather generate a readonly property instead?