Change Signature not working as expected

Using "Ctrl + F6 -- Change Signature" doesn't work as expected when invoked from within a calling file.

Build 240 -- Visual Studio 2003

Steps to reproduce:
public class MyCalledClass {
public static void DeleteSomething(long id){
//do delete
}
}

public class CallingClass{
public void CascadeDelete(IProduct product){
MyCalledClass.DeleteSomething(product.Id);
}
}

1. Change calling class to the following:
public class CallingClass{
public void CascadeDelete(IProduct product){
MyCalledClass.DeleteSomething(product.Id, product.Position);
}
}

2. Resharper will tell you that "Method MyCalledClass.DeleteSomething" has one parameter but is invoked with two arguments"
3. From within CallingClass, place your cursor within the word "DeleteSomething" and choose Ctrl+F6.
4. In the "Name:" field change the name to "Delete"
5. Under "Parameters" add a new "long" parameter called "position" and set its default value to "null"
4. Click "Continue"

The result: (As expected)
===============================
public class MyCalledClass {
public static void Delete(long id, long postion){
//do delete
}
}

(Incorrect Result is in the calling class)
public class CallingClass{
public void CascadeDelete(IProduct product){
MyCalledClass.DeleteSomething(id, position);
}
}

Basically, MyCalledClass.DeleteSomething(long id) is changed to MyCalledClass.Delete(long id, long position) which is expected but is not changed in the CallingClass where it is invoked.

Thanks and please let me know if you have any questions.

-- Rodney

1 comment
Comment actions Permalink

Hello Rodney,

Please submt this bug to our issue tracker.

Oleg Stepanov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Using "Ctrl + F6 -- Change Signature" doesn't work as expected when
invoked from within a calling file.

Build 240 -- Visual Studio 2003

Steps to reproduce:
public class MyCalledClass {
public static void DeleteSomething(long id){
//do delete
}
}
public class CallingClass{
public void CascadeDelete(IProduct product){
MyCalledClass.DeleteSomething(product.Id);
}
}
1. Change calling class to the following:
public class CallingClass{
public void CascadeDelete(IProduct product){
MyCalledClass.DeleteSomething(product.Id,
product.Position);
}
}
2. Resharper will tell you that "Method MyCalledClass.DeleteSomething"
has one parameter but is invoked with two arguments"

3. From within CallingClass, place your cursor within the word
"DeleteSomething" and choose Ctrl+F6.

4. In the "Name:" field change the name to "Delete"

5. Under "Parameters" add a new "long" parameter called "position" and
set its default value to "null"

4. Click "Continue"

The result: (As expected)
===============================
public class MyCalledClass {
public static void Delete(long id, long postion){
//do delete
}
}
(Incorrect Result is in the calling class)
public class CallingClass{
public void CascadeDelete(IProduct product){
MyCalledClass.DeleteSomething(id, position);
}
}
Basically, MyCalledClass.DeleteSomething(long id) is changed to
MyCalledClass.Delete(long id, long position) which is expected but is
not changed in the CallingClass where it is invoked.

Thanks and please let me know if you have any questions.



0

Please sign in to leave a comment.