Closed chandan192 closed 2 years ago
Thanks for the bug report! I'll update when I have a fix.
Hey @chandan192 - I agree that inlining here does not make sense, and you would typically not invoke it.
However, I'm not sure I understand what the issue with the refactoring is? The resulting code compiles and executes for me, and it indeed the expected result of an inline operation on temp3.
What would you expect to happen instead?
Hi @lgrammel,
I was just experimenting with the refactoring using p42 and tslint. I got the p42 refactoring suggestion on the context menu.
Inline 2 occurrences [p42]
I also checked the p42 suggestion on the activity bar but there was no suggestion. It was only on the manual context menu refactoring.
I see - in this case it was not a 'suggestion' (an in, P42 recommended), but it showed up in the quickfix menu. I'll add a warning similar to what is shown for new Objects.
I've made a couple of improvements in v1.103.1
to address this issue:
Thanks for the bug report!
Previous Code
const temp3 = []; temp3[0] = temp1; temp3[1] = temp2;
![Uploading image.png…]()
After refactoring
[][0] = temp1; [][1] = temp2;