Quantcast
Channel: YouTrackReSharper (RSRP) - Bug and Issue Tracker
Viewing all articles
Browse latest Browse all 106942

RSRP-98383: Resharper incorrectly create setter for readonly field

$
0
0
Reporter Kenneth Siewers Møller (tigershark) Kenneth Siewers Møller (tigershark)
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.

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?

Viewing all articles
Browse latest Browse all 106942

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>