Details
-
Bug
-
Resolution: Invalid
-
P4: Low
-
None
-
Qt Creator 2.7.0, Qt Creator 4.7.1
-
None
Description
Consider the following function:
QString joinWithDots(const QString &s1, const QString &s2, const QString &s3) { return s1 + '.' + s2 + '..' + s3; }
Let there also be a declaration of it at some other place, e.g. a header file.
Now let's say I want to wrap these parameters in a struct, and I change the signature in the declaration accordingly:
struct strings {
QString s1, s2, s3;
};
QString joinWithDots(const strings &s);
When I tell Qt Creator to apply the signature change, it also changes the function body thusly:
return s + '.' + s2 + '..' + s3;
I can see how such behavior makes sense if only the name of a parameter changes, but this is clearly not a 1:1 mapping, since the number of parameters has changed, as well as the type of the first parameter. In such a case, the current behavior most likely does not match users' expectations.