Community
Participate
Working Groups
Start with the following code: void test(bool cond) { int x, y; (cond ? x : y) = 1 + 2; } select the expression '(cond ? x: y)' and perform the 'Extract local variable' refactoring. The result is: void test(bool cond) { int x, y; int extracted = cond ? x : y; extracted = 1 + 2; } which clearly loses the original intent of the code. The type of 'extracted' should be 'int&' instead.