When I Extract Method on some code, the refactoring dialog gives me no feedback on existing method names to know if I am creating a conflict or not.
It shouldn't let me extract a method/function that shadows an existing signature and it should provide some means for me to see the existing method names on the class where I'm extracting. For functions, it should show me functions from the same enclosing namespace, excluding those from headers marked "stable".
The lack of feedback gives me an opportunity to create invalid code by selecting the defaults.
class Foo
{
void MyMethod()
{
// Extract Method on line below
std::cout << "MyMethod\\n";
}
};
yields:
class Foo
{
void MyMethod()
{
// Extract Method on line below
MyMethod();
}
void MyMethod()
{
std::cout << "MyMethod\\n";
}
};
...which is invalid code.