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.