Open sircfenner opened 3 months ago
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 👍
For example, applying
remove_assertions
with the default parameter for the rule, the following input:becomes:
This changes runtime behavior in an unexpected way, because
head
is alwaysnil
even when the character does have a child named Head. Expected output is:When
preserve_aguments_side_effects
is set tofalse
, the output is: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.