Skip to content

[Sema] Fix hole where missing_nullary_call wasn't diagnosed in ternary condition. #74464

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
Jun 17, 2024

Conversation

gregomni
Copy link
Contributor

Added a check for function produces expected type 'Bool'; did you mean to call it with '()'? when in the position of a condition for a ternary expression. Because of the way ContextualFailures are diagnosed, this particular diagnostic couldn't be hit before.

Resolves #46902.

@gregomni gregomni requested review from hborla and xedin as code owners June 16, 2024 21:30
@gregomni
Copy link
Contributor Author

@swift-ci Please smoke test.

Copy link
Contributor

@hamishknight hamishknight left a comment

Choose a reason for hiding this comment

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

Thanks!

@gregomni
Copy link
Contributor Author

@swift-ci Please smoke test.

@xedin
Copy link
Contributor

xedin commented Jun 17, 2024

If you'd be interested in trying a more challenging diagnostic fix - #67791 (comment). I think I reduced this at some point to a ternary as well but I cannot find it.

@gregomni
Copy link
Contributor Author

@xedin I'll give it a shot!

@gregomni gregomni merged commit 3e7f323 into swiftlang:main Jun 17, 2024
3 checks passed
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.

[SR-4319] Invalid inferred diagnostic with IOU and ?:
3 participants