Invalid convert to auto-property gets suggested
Given the following:
private RectangleF _someRectangle;
public RectangleF SomeRectangle
{ get { return _someRectangle; } }
ReSharper will suggest that this can be converted to an auto-property with a private setter. However later in the code the fields of the rectangle are updated
_someRectangle.X = some_value;
_someRectangle.Width = some_other_value;
and that becomes
SomeRectangle.X = some_value;
SomeRectangle.Width = some_other_value;
Which results in a "Cannot modify the return value of '...SomeRectangle' because it is not a variable".
How do I turn off the suggestion for specific instances? Unlike other options the context menu doesn't provide a way to comment out this suggestion.
Please sign in to leave a comment.