Skip to content

Conversation

@LucianoPAlmeida
Copy link
Contributor

@LucianoPAlmeida LucianoPAlmeida commented Feb 25, 2023

In previous PR was handling only failures located in argument mismatch, but ambiguity of overload in coerce subexpr can come from other fixes as well e.g. contextual mismatch, not only located in FunctionArgument. So is a more general approach look for the overload subexpr.

Resolves #63834

@LucianoPAlmeida
Copy link
Contributor Author

@swift-ci Please smoke test

Copy link
Collaborator

@AnthonyLatsis AnthonyLatsis 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!

@LucianoPAlmeida LucianoPAlmeida force-pushed the ambiguous-overload branch 4 times, most recently from 7e88e66 to 33b8fde Compare February 25, 2023 02:28
@LucianoPAlmeida
Copy link
Contributor Author

@swift-ci Please smoke test

@AnthonyLatsis
Copy link
Collaborator

@swift-ci please smoke test

@LucianoPAlmeida
Copy link
Contributor Author

@swift-ci Please smoke test

@LucianoPAlmeida LucianoPAlmeida force-pushed the ambiguous-overload branch 2 times, most recently from c37eaa4 to b5e184b Compare February 26, 2023 17:23
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.

Looking good! Just one more comment, and a suggestion for potential future work that could be done here

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.

LGTM! I'll let @xedin have the final say though

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.

This feels like a workaround for the fact that fixes don't have correct locators for some specific situations where the problem is with structure of the types being coerced, should be adjust locator at the point of fix instead?

@LucianoPAlmeida
Copy link
Contributor Author

You mean record the fix anchored on the coerce subexpr in those cases?
Or maybe still record fix on the coerce expr but with additional path elt that we can use to simplify down to the subexpr?

@LucianoPAlmeida LucianoPAlmeida changed the title [Sema] Handle coerce subexpr overload in getCalleeLocator [Sema] Diagnose function coercion ambiguity Mar 11, 2023
@LucianoPAlmeida
Copy link
Contributor Author

@swift-ci Please smoke test MacOS

@xedin xedin self-requested a review March 11, 2023 20:21
@LucianoPAlmeida
Copy link
Contributor Author

@swift-ci Please smoke test MacOS Platform

@LucianoPAlmeida LucianoPAlmeida force-pushed the ambiguous-overload branch 2 times, most recently from 837a109 to af584bd Compare March 15, 2023 02:04
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.

Looks great, thank you!

@LucianoPAlmeida
Copy link
Contributor Author

@swift-ci Please test

@LucianoPAlmeida
Copy link
Contributor Author

@swift-ci Please test MacOS Platform

@LucianoPAlmeida LucianoPAlmeida merged commit 4d981e3 into swiftlang:main Mar 16, 2023
@LucianoPAlmeida LucianoPAlmeida deleted the ambiguous-overload branch March 16, 2023 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants