Skip to content

[Sema] Handle non-function type parameters for closure arguments in ambiguity diagnositc #60819

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
Aug 29, 2022

Conversation

LucianoPAlmeida
Copy link
Contributor

diagnoseContextualFunctionCallGenericAmbiguity assumed that closure argument parameter would be always a function type which is not the case for a generic argument T that can be inferred as a closure. So in this we just check for this case and let generic diagnoseConflictingGenericArguments handle the diagnostic.
Also, adding InsertCall fix for diagnoseConflictingGenericArguments because it is a tailored mismatch diagnostic for () -> Int vs. Int

Resolves #60781

@LucianoPAlmeida LucianoPAlmeida requested a review from xedin August 27, 2022 23:48
@LucianoPAlmeida
Copy link
Contributor Author

@swift-ci Please test

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 xedin merged commit 05648c1 into swiftlang:main Aug 29, 2022
@LucianoPAlmeida LucianoPAlmeida deleted the crash-generic-ambiguity branch September 10, 2022 01:54
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.

Compiler crashes on invalid inference for closure argument to generic param
2 participants