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

RSRP-278599: 'Initialize field from constructor(s) parameter' Creates Public Constructor In Abstract Class

$
0
0
Reporter Kevin Watkins (MrKWatkins) Kevin Watkins (MrKWatkins)
Created Nov 7, 2011 2:23:49 PM
Updated Mar 27, 2012 5:03:10 PM
Priority Normal
Type Bug
Fix versions 7.0
State Submitted
Assignee Alexey Kuptsov (alexey.kuptsov)
Subsystem Refactoring
Affected versions 6.0, 6.1
Fixed in build No Fixed in build
If I have the following:

public abstract class Class
{
    private readonly string field;
}


Click on field and then on 'Initialize field from constructor(s) parameter' in the actions list I get the following:

public abstract class Class
{
    private readonly string field;

    public Class(string field)
    {
        this.field = field;
    }
}


However the constructor should really be protected, not public, because it is an abstract class. In fact ReSharper immediately warns me about this!

Viewing all articles
Browse latest Browse all 106942

Trending Articles



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