Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 1724: refactor rename misses occurrences

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
SamHocevar Posted - Jun 25 2009 : 06:51:33 AM
VAX doesn't seem to properly refactor the following code, where two loop variables have been mistakenly given the same name, causing no bug because their scopes are properly nested, but being still bad style:
#include <iostream>

int main(void)
{
    for(int i = 0; i < 10; i++)
    {
        std::cout << "Outer loop " << i << "\\n";

        for (int i = 0; i < 5; i++)
            std::cout << "  Inner loop " << i << "\\n";
    }
}


1) Renaming the first "i" by right-clicking on one of its occurrences in the first "for" loop causes it to miss the one in the following std::cout line.

2) Renaming the first "i" by right-clicking in the first std::cout line causes it to miss the ones in the first "for" block and attempt to rename the ones in the second "for" block, despite them having a different scope.

3) Renaming the second "i" (using any occurrence of it) causes it to wrongly suggest the occurrence in the first std::cout line.
1   L A T E S T    R E P L I E S    (Newest First)
accord Posted - Jun 25 2009 : 4:35:42 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