class Foo
{
public:
int doFoo(int bar, bool baz) { return (baz ? 42 : bar); };
}
class SubFoo : public Foo
{
public:
int doFoo(int bar) { return Foo::doFoo(bar, false); };
}
Attempting to refactor the doFoo() function via "Change signature" (switching the places of the 'int bar' and 'bool baz' parameters) the Foo class leads to unexpected results and an error:
class Foo
{
public:
// All good & well here
int doFoo(bool baz, int bar) { return (baz ? 42 : bar); };
}
class SubFoo : public Foo
{
public:
// Error here: SubFoo::doFoo() got the 'bool baz' parameter from Foo:doFoo()
int doFoo(bool baz, int bar) { return Foo::doFoo(false, bar); };
}
Fortunately Visual assists normally warns that something went wrong ("Visual Assist failed to modify one or more files...") - even though the error message is incorrect too (it did change the file, but incorrectly)
System Info:
Visual Studio 2015 Update 3, C++
License: [email protected] (2-user license) Support ends 2019.06.14
VA_X.dll file version 10.9.2283.2 built 2018.08.02
DevEnv.exe version 14.0.25420.1 Professional
msenv.dll version 14.0.25431.1
Comctl32.dll version 6.10.17134.285
Windows 10 10.0 Build 17134.285
8 processors (x86-64, WOW64)
Language info: 1252, 0x407