Skip to content

Precedence of certain operations is tampered by formatting. #623

Description

@bmcq-0

The formatter currently removes necessary parentheses around certain expressions. Take the following code for example:

return (-X) ^ Y

...is formatted to:

return -X ^ Y

These expressions are NOT the same and this will lead to very obscure issues (-X ^ Y being parsed as -(X ^ Y) and not (-X) ^ Y seems to be not commonly known and will cause issues especially for beginners.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions