Skip to content

[Sema] Add param indicate diagnose or not in lookupPrecedenceGroupForInfixOperator #61066

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
merged 1 commit into from
Sep 14, 2022

Conversation

LucianoPAlmeida
Copy link
Contributor

@LucianoPAlmeida LucianoPAlmeida commented Sep 13, 2022

While attempting to emit a fix-it for a diagnostic exprNeedsParensInsideFollowingOperator indirectly calls lookupPrecedenceGroupForInfixOperator which by default also emits diagnostics which in this case crashes diagnostic engine. So we add the option to call lookupPrecedenceGroupForInfixOperator without any diagnostic in cases are not needed.

Resolves: #60954
Resolves: rdar://99562101

@LucianoPAlmeida LucianoPAlmeida marked this pull request as ready for review September 13, 2022 04:00
@xedin
Copy link
Contributor

xedin commented Sep 13, 2022

@LucianoPAlmeida could we instead base the diagnostic on presence of loc like we do in some other case i.e. conformance checking?

@LucianoPAlmeida
Copy link
Contributor Author

@LucianoPAlmeida could we instead base the diagnostic on presence of loc like we do in some other case i.e. conformance checking?

Just adjusted :)

Copy link
Contributor

@xedin xedin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@xedin
Copy link
Contributor

xedin commented Sep 14, 2022

@swift-ci please test

@xedin xedin merged commit ad5fdf7 into swiftlang:main Sep 14, 2022
@LucianoPAlmeida LucianoPAlmeida deleted the diagnose-operator-crash branch September 15, 2022 01:05
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.

include/swift/AST/DiagnosticEngine.h:993: Assertion `!ActiveDiagnostic && "Already have an active diagnostic"' failed
2 participants