-
Notifications
You must be signed in to change notification settings - Fork 10.5k
SR-2505: Fix "Call arguments did not match up" assertion #5286
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
Conversation
/cc @rudkx |
@xedin Can you add a test case similar to the gist that I posted as well? https://gist.github.com/rudkx/3fa7aca590f344f5613337644a21b97f You can remove the three prints, the associated type, typealias, protocol Initable, etc. and just leave enough in to ensure that we continue to call the correct test() method. |
@rudkx Sure, i'll do it right away. |
@rudkx Done! |
@xedin Great! I'll start tests now and take a closer look at the change tomorrow. |
Thanks! |
@swift-ci Please smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM. Make those changes and I'll re-run tests and merge.
let c_2505 = C_2505(arg: [C2_2505()]) // expected-error {{argument labels '(arg:)' do not match any available overloads}} expected-note {{overloads for 'C_2505' exist}} | ||
|
||
// make sure that behavior related to allowing trailing closures to match functions | ||
// with Any as a final parameter is unchanged due to change made by SR-2505 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you clarify this comment to say that the test is to ensure that we continue to select the function that does not have Any as a final parameter?
} | ||
} | ||
|
||
let _ = C_SR_2505().call(C_SR_2505()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move this whole test into closures.swift instead?
I think it probably makes more sense there.
@rudkx Absolutely! |
@rudkx Done - rebased with the latest master, changed tests as you requested. |
@@ -1,3 +1,4 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove the extra line here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, sorry, I don't know how it got there...
Always check arguments of the tuple type against corresponding parameters, otherwise for a single argument functions e.g. foo(_ a: Any) after SE-0046 type checker is going to produce incorrect solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Will restart tests & merge.
@swift-ci Please smoke test and merge. |
Looks like auto-merge feature is still broken in CI :( |
Thanks for the patch! |
Always check arguments of the tuple type against corresponding parameters,
otherwise for a single argument functions e.g. foo(_ a: Any) after SE-0046
type checker is going to produce incorrect solution.
Resolves SR-2505.