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

RSRP-69667: Suggest when field is not required

$
0
0
Reporter Drew Noakes (drewnoakes) Drew Noakes (drewnoakes)
Created May 23, 2008 5:23:50 PM
Updated Apr 11, 2018 6:44:11 PM
Subsystem Code Analysis
Assignee Ivan Serduk (IvanSerduk)
Priority Normal
State Open
Type Feature
Fix version Backlog
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
In the following code, the field is not required. It would suffice to make both usages local in scope. I can't think of a scenario in which applying this change would break the code's behaviour.

public sealed class TestClass
{
private string _field;

public void A()
{
_field = "A";
_field.ToString();
}

public void B()
{
_field = "B";
_field.ToString();
}
}

Viewing all articles
Browse latest Browse all 106942

Trending Articles



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