Skip to content

[Sema] Increase impact of ternary then branch aiming better diagnostics #66208

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
May 31, 2023

Conversation

LucianoPAlmeida
Copy link
Contributor

Another small diagnostic quality one.
In this scenario, solution which recorded the argument mismatch on the result of ternary which is the correct fix to apply in that case was being considered worst than the then branch contextual mismatch leading to misleading diagnostics. To me it does make sense to have the ternary branch slightly worst to avoid this sort of things, but let me know what you think.

Resolves #66192

@LucianoPAlmeida
Copy link
Contributor Author

@swift-ci Please smoke test

@LucianoPAlmeida
Copy link
Contributor Author

@swift-ci Please smoke test

@LucianoPAlmeida LucianoPAlmeida merged commit 1d90de1 into swiftlang:main May 31, 2023
@LucianoPAlmeida LucianoPAlmeida deleted the diag-ternary branch May 31, 2023 04:24
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.

Poor diagnostic for conditional expression result type error
2 participants