Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExplicitPrecedenceViaParentheses rule #700

Open
knocte opened this issue Feb 17, 2024 · 1 comment
Open

ExplicitPrecedenceViaParentheses rule #700

knocte opened this issue Feb 17, 2024 · 1 comment

Comments

@knocte
Copy link
Collaborator

knocte commented Feb 17, 2024

Even if F# follows strict precedence rules, programmers are not infallible and might not know them.

Therefore, for code like this:

let it = 1 |> (fun a b -> a) <| 2

It would be better to recommend parentheses:

let it = (1 |> (fun a b -> a)) <| 2
@knocte
Copy link
Collaborator Author

knocte commented Feb 17, 2024

More testcases:

a || b && c

(should give suggestion)

(a || b) && c

(should not give suggestion)

a || (b && c)

(should not give suggestion)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant