Skip to content

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