Skip to content

[CS] Fix diagnostic fix-it paren handling #38631

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

Merged

Conversation

hamishknight
Copy link
Contributor

Don't consider implicit TupleExprs in exprNeedsParensOutsideFollowingOperator, as such implicit tuples may be used to represent argument lists for e.g binary expressions, and as such shouldn't be considered as parent exprs that satisfy the role of parentheses.

Also fix the callers to use the raw anchor as the root expression they pass to provide an accurate parent map. This requires sinking the UnresolvedMemberChainResultExpr handling logic into getPrecedenceParentAndIndex.

rdar://81109287

…owingOperator

Such implicit tuples may be used to represent
argument lists for e.g binary expressions, and as
such shouldn't be considered as parent exprs that
satisfy the role of parentheses.

Also fix the callers to use the raw anchor as the
root expression they pass to provide an accurate
parent map. This requires sinking the
UnresolvedMemberChainResultExpr handling logic into
`getPrecedenceParentAndIndex`.

rdar://81109287
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight hamishknight requested a review from xedin July 26, 2021 17:24
@hamishknight hamishknight merged commit b3356b0 into swiftlang:main Jul 27, 2021
@hamishknight hamishknight deleted the theres-precedence-for-this branch July 27, 2021 09:52
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

Successfully merging this pull request may close these issues.

2 participants