-
-
Notifications
You must be signed in to change notification settings - Fork 34
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
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.
matthargett
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working