Closed andrewhongnsw closed 2 years ago
I'm guessing it's only looking at it as an expression, and if the result of the expression is being used then it needs to maintain the existing behaviour, eg.
Foo(value1 |= false);
becomes
Foo(value1);
We should probably detect if the parent of the resulting expression is an ExpressionStatement, and if it is, delete it. Would need to be careful of the possibility that the statement to be deleted is not contained within a BlockStatement though.
if (Foo()) Value1 |= false;
The following or assignment expression is handled correctly:
Example 1
...becomes...
However the following or assignment expression becomes an invalid statement, triggering CS0201.
Example 4
...becomes...