Skip to content

Conversation

LucianoPAlmeida
Copy link
Contributor

Handle CoerceExpr in getCalledLocator for FunctionArgument locator to return in a locator anchored on subexpr.
diagnoseAmbiguityWithFixes can properly diagnose this overload ambiguity by callee locator.

Resolves #63834.

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!

@LucianoPAlmeida
Copy link
Contributor Author

@swift-ci Please smoke test

@LucianoPAlmeida LucianoPAlmeida merged commit 83888d3 into main Feb 23, 2023
@LucianoPAlmeida LucianoPAlmeida deleted the ambiguous-coerce branch February 23, 2023 12:06
@AnthonyLatsis
Copy link
Collaborator

I’m both surprised and pleased by how simple the solution is.

@LucianoPAlmeida Something’s telling me this wouldn’t work with as (Int) -> Void or as Int (these produce the same fallback diag but I forgot to include them in the issue).

@LucianoPAlmeida
Copy link
Contributor Author

No problem @AnthonyLatsis, I'll try to take a look on those today after work or over the weekend.
Should we reopen with those extra cases? Or create a new issue?

@AnthonyLatsis
Copy link
Collaborator

Thanks! I vote to reopen since the productions are so similar. Will do this in a minute if that's fine.

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.

Disambiguation of function ref using coercion to non-matching type produces unhelpful error
3 participants