Unwanted behaviour in Remove Unused --> Variables

Hi,

Remove Unused → Variables removes used variables.

The following bug is observed in

image

Before deletion

I then used the remove unused variables
image

However, this deletes the only variable SampleText which is assigned a value and being consumed in a Log Message activity.

  1. In short, SampleText is not a orphan/unused variable
  2. I am in the same scope before and after
  3. The consumption of the variable also happens within the same scope

This is is how it looks after in the studio
image

I have used this feature in 21.10.3 and it worked well, I am not sure why this happens in the latest version. Here is the file for your tests : GetSampleText.xaml (15.7 KB)

Other slightly related threads / feedback

  1. Remove Unused Variable - #7 by AndrewHall
  2. Remove unused variables not working as intended on C# projects
1 Like

Thank you for the detailed report. I saved it in the issue tracker for the Studio team to have a look.

This is fixed with the new 22.6 preview version. You will get to try it by the end of the month. Thanks for feedback and for your patience.

2 Likes