Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 refactor->rename wrong behavior

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
Voivoid Posted - Sep 10 2013 : 02:34:28 AM
Consider the following code:

static const int val = 42;
int main() {
  int tmp = val;
  int val = 0;  
  return val;
}

Move cursor to the line 'return val;'. Try refactor-rename to rename 'val' variable. 'int tmp = val' line changes though it should not.
static const int val = 42;
int main() {
  int tmp = val_new;
  int val_new = 0;  
  return val_new;
}


VA 10.7.1949.0
3   L A T E S T    R E P L I E S    (Newest First)
accord Posted - Sep 12 2013 : 2:21:41 PM
Basically, when you define an outer and inner scope variable with the same name, it always fails, I mentioned the cases in the bug report.
Thank you for the sample, though.
Voivoid Posted - Sep 12 2013 : 08:27:41 AM
A few more cases:

int main() {
  int n = 0;
  for( int n = 0; n < 10; ++n ) {
  }
  ++n;
  return 0;
}

1) Move cursor to
int n = 0
Try to rename 'n'. The following line changes though it should not
for( int n = 0; n < 10; ++n ) {


2) Move cursor to
for( int n = 0; n < 10; ++n ) {
Try to rename 'n'. The following line changes though it should not
int n = 0
accord Posted - Sep 10 2013 : 5:34:44 PM
I am seeing the same effect here. Thank you for the clear description.

case=3414

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000