`remove_assertions` changes return value when used in a call expression
For example, applying remove_assertions with the default parameter for the rule, the following input:
local head = assert(character:FindFirstChild("Head"), "head is missing!")
becomes:
local head = character:FindFirstChild("Head") and nil
This changes runtime behavior in an unexpected way, because head is always nil even when the character does have a child named Head. Expected output is:
local head = character:FindFirstChild("Head")
When preserve_aguments_side_effects is set to false, the output is:
local head = nil
Not sure if this is intended either. I think whether the return value is used (so, whether the assert is an expression or a statement?) should probably be factored in here.
Tested on version 0.13.0.
Oh interesting! I believed I might have taken for granted that assert returned nothing, as I've used it mostly just like a call statement like:
assert(condition, "message")
Thank you for reporting the issue! It does not seem complicated so it should be fixed soon 👍