-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Area-IDEFeature Requesthelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on itThe issue is "up for grabs" - add a comment if you are interested in working on it
Milestone
Description
Version Used:
17.10.0 Preview 3.0
Steps to Reproduce:
Run "Extract method" on the return statement:
public class Test(int value) {
public int M() {
return value + 1; // <-- here
}
}Expected Behavior:
The primary constructor parameter should be used in the generated method, so the method should have no parameters:
public class Test(int value) {
public int M() {
return NewMethod();
}
private int NewMethod() {
return value + 1; // <-- here
}
}Actual Behavior:
The primary constructor parameter is converted to a method parameter and either shadows the primary constructor parameter if it needs to be an instance method or the method becomes static.
public class Test(int value) {
public int M() {
return NewMethod(value);
}
private static int NewMethod(int value) {
return value + 1; // <-- here
}
}Rekkonnect
Metadata
Metadata
Assignees
Labels
Area-IDEFeature Requesthelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on itThe issue is "up for grabs" - add a comment if you are interested in working on it
Type
Projects
Status
Completed