Refactoring to change return type?

Is there a refactoring for C++/Objective-C++ code to change a methods return type?

I've just tried to change the signature from

   static CDebugManager *Instance()

to

   static CDebugManager &Instance()


but after invoking "Refactor signature" and hitting 'Refactor' nothing at all was changed.

Any hints appreciated!

Cheers,
Jay

0

Jay, there is no such a refactoring at the moment, please follow this issue and feel free to leave additional comments.

0

Jay, we also couldn't reproduce the issue with changing signature of return type from pointer to a reference. If you have sample project, please create a separate issue in the tracker and attach the sample there.

0

Hmm, happens every time for me.
I'll create an issue with a simple C++ sample project.

Cheers,
Jay

0

Please try refactoring this method from string * to string & - the void parameter appears to be the crucial bit breaking the refactoring!

   string * TestStuff( void )
   {
      static string test = "TEST";
      return &test;
   }



Cheers,
Jay

0

Hi Alex,

In addition to the refactoring bug where it doesn't refactor anything even in cases where the refactoring works it's barely a find and replace operation..
All usages of the method are broken, i.e. for the example

   string * TestStuff( void )

after refactoring all invocations of obj.TestStuff()->size() remain the same and have to be converted to obj.TestStuff().size() manually.

Cheers,
Jay

0

Awesome, thanks!
Can't wait for the fix :-)

cheers,
Jay

0

请先登录再写评论。