History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: RSRP-40465
Type: New Feature New Feature
Status: Open Open
Priority: Normal Normal
Assignee: Sergey Shkredov
Reporter: Andrew Serebryansky
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
ReSharper

'Change Signature' should support choosing the return value

Created: 14 May 07 12:41   Updated: 23 Jan 08 12:57
Component/s: Refactorings - Change Signature
Fix Version/s: Future Versions
Security Level: Everybody (All jira users)

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown


 Description  « Hide
The "Extract Method" refactoring, when used on code that could have more than one "out" parameter, permits the selection of one of those parameters as the return value of the extracted method. Yet, there is no easy way to change which "parameter" is turned into the return value.

It is suboptimal that the method to correct a mistaken choice of output parameter is to use "Undo" rather than to use "Change Signature". It doesn't work well if there have been intervening changes one would like to keep.

This should also be available when "Change Signature" is used to add an "out" or "ref" parameter. It should be possible to designate one or more of the new parameters as the return value.



 All   Comments   Work Log   Change History      Sort Order:
Sergey Shkredov - 23 Jan 08 12:57
The transformation is obvious in the trivial case only:
int i = xxx;
  int j = foo(out i);

When return value in not directly assigned to variable transformation is complex and can change semantic.

int val; 
if (x.TryGetValue("key", out val))
{
  
}