Skip to content

[ConstraintSystem] Port function parameter type mismatch diagnostics. #28712

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

Conversation

hborla
Copy link
Member

@hborla hborla commented Dec 11, 2019

This allows us to remove diagnoseTrailingClosureErrors from CSDiag.

@hborla hborla requested a review from xedin December 11, 2019 18:48
@hborla
Copy link
Member Author

hborla commented Dec 11, 2019

@swift-ci please smoke test

@@ -3543,19 +3543,21 @@ bool ConstraintSystem::repairFailures(

// Drop the `tuple element` locator element so that all tuple element
// mismatches within the same tuple type can be coalesced later.
auto index = elt.getAs<LocatorPathElt::TupleElement>()->getIndex();
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to double-check - this is an intermediate step until we get ApplyArgToParam generalization, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Much of this is intermediate until we get a generalized ApplyArgToParam locator - especially the getStructuralTypeContext function in CSFix.cpp. That function is filling in the contextual information that we're missing.

That said, this particular line of code is just to keep track of which tuple elements/parameters don't match (it was there before, previously on line 3556, I just moved it up).

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good! I just needed to put this comment on one of the lines because otherwise GitHub doesn't support discussion if I just leave it as review comment :)

@hborla
Copy link
Member Author

hborla commented Dec 11, 2019

@swift-ci please smoke test Linux platform

@hborla hborla merged commit 3d1ab4d into swiftlang:master Dec 11, 2019
@hborla hborla deleted the function-parameter-mismatch-diagnostics branch December 11, 2019 22:33
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.

2 participants