Rename field when new name already exists

Completed

Take the following code:

private static readonly IDictionary<string, string> _cache = new Dictionary<string, string>();

private static string Cache()
{
    return "hi mum!";
}

Ignoring the fact that it's proper code smell... One of the suggestions is to adjust the field name as my style is Initial Caps for that static/readonly field.

It cannot do so because the method has the intended name. I didn't notice as I have had a light ale.

My suggestion is this. When the expected option is missing (in this case rename to Cache), have a little note to indicate why it cannot be done. Not just for this, but any error of this nature...

1 comment
Comment actions Permalink
Official comment

Hello Ed,

There is very similar ticket in YouTrack https://youtrack.jetbrains.com/issue/RSRP-336895. I added such post to comments.

Thanks!  

Please sign in to leave a comment.