T O P I C R E V I E W |
podfish |
Posted - Sep 29 2006 : 11:52:10 AM this seems to always return VOID. It would be nice to have the dialog (where you enter a name for your method) also have a combo-box that lets you select a variable (or even better, any lvalue) from your code that would become the return value and establish the return-type of the method. |
1 L A T E S T R E P L I E S (Newest First) |
feline |
Posted - Sep 30 2006 : 11:41:16 AM i have seen VA generate a return type in my code. not all of the time, certainly, but it does happen.
this is a reasonable idea, but it will run into problems if the extracted code has no need to return a value. what happens if the extracted code needs to modify two variables, so they are both passed in as references?
plus it introduces an extra dialog. the design principle behind VA's refactoring is to use a set of very "small" tools, and then let the user chain them together however they want.
in this case i would suggest using extract method, and then using Change Signature afterwards to add the return type. |
|
|