-
Notifications
You must be signed in to change notification settings - Fork 803
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
Parens: Keep parens for non-identical infix operator pairs with same precedence #16372
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Keep parens in cases like `f <| (g << h)`, `x + (y ++ z)`, etc.
* The order of operations in `x > (y < z)` or `x <> (y <> z)` is not necessarily immediately obvious, and there are built-in operators in this class like `<|` for which the associativity of the underlying operation depends on the types of the operands.
psfinaki
reviewed
Dec 4, 2023
psfinaki
approved these changes
Dec 4, 2023
2 tasks
@brianrourkeboll this can also go once the release notes conflict is resolved :) @dotnet/fsharp-team-msft please take a look |
auto-merge was automatically disabled
December 13, 2023 20:00
Head branch was pushed to by a user without write access
All right @psfinaki, I think this should finally be good now that the release notes PR has been merged in. |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
T-Gro
approved these changes
Dec 15, 2023
OwnageIsMagic
added a commit
to OwnageIsMagic/fsharp
that referenced
this pull request
Dec 21, 2023
* upstream/main: (166 commits) typo in foldBack summary (dotnet#16453) Fix for dotnet#83 (improve constraint error message) (dotnet#16304) Name resolution: resolve interfaces in expressions (dotnet#15660) AddExplicitReturnType refactoring (dotnet#16077) Disabling 2 tests: running for too long, causing CI timeouts Improve value restriction error message dotnet#1103 (dotnet#15877) Parens: Keep parens for non-identical infix operator pairs with same precedence (dotnet#16372) More release note entries (dotnet#16438) Using Ordinal is both faster and more correct as our intent is to do … (dotnet#16439) merge (dotnet#16427) Optimize empty string compares (dotnet#16435) Checker: recover on unresolved type in 'inherit' member (dotnet#16429) Release notes proposal (dotnet#16377) [main] Update dependencies from dotnet/source-build-reference-packages (dotnet#16411) Allow usage of [<TailCall>] with older FSharp.Core package versions (dotnet#16373) Parser: recover on unfinished 'as' patterns (dotnet#16404) Parens: Keep parens in method calls in dot-lambdas (dotnet#16395) Checker: check unfinished obj expression inside computations (dotnet#16413) Added default dotnet-tools + additional tasks to launch them (dotnet#16409) make `remarks` and `returns` visible in quick info (dotnet#16417) ...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Another followup to #16079.
Description
Keep parentheses for non-identical infix operator pairs that have the same precedence, e.g.:
etc.
We still offer to remove them when both operators are the same, e.g.:
except for the left-associative "relational" operators (
=…
,|…
,&…
,$…
,>…
,<…
,!=…
, including|>
,<|
,>>
,<<
, etc.), where the order of operations is often arguably non-obvious:Checklist