Open calda opened 1 year ago
Adding "return"
to the rule's set of "conditionals" addresses the first case (return (true)
→ return true
). Adding it to either of these locations seems to be equivalent:
... but it seems like the second case (return try (...)
) needs some additional support.
I don't think it was intentional, but there may be some edges cases with return that I've forgotten about (e.g. if statement spans multiple lines and removing parens changes meaning).
With try, removing parens should also be fine, but have to be careful in try? case due to optional elision.
We've found some cases where the
redundantParens
rule isn't removing redundant parenthesis, for example in a return statement. Here are some test cases that currently fail on develop:Is this a bug / oversight, or is this intentional?