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
[SR-2008] Implement SE-0110: Distinguish between single-tuple and multiple-argument function types #44617
Comments
Part I (disallow multi-argument to tuple coercion) implemented: #3895 |
PaulMeng (JIRA User), is this done? |
Comment by Paul (JIRA) Yes. It's merged. |
Comment by Paul Meng (JIRA) Uh, sorry. Logged-in with the wrong account. It's merged. |
This is done, but didn't make it into Swift 3 |
Comment by Alex Martini (JIRA) The implementation was reverted: |
Comment by Paul Meng (JIRA) Let me look into it and propose a fix. |
Comment by Greg Lutz (JIRA) I was hoping that the implementation of SE-0110 would end up fixing SR-1795, but I'm not so sure it will. The point is, if single-tuple and multiple-argument functions are distinguishable, they'd damn well better mangle to different names! So they can, for example, co-exist in the same module. |
apple/swift#3895 was reverted by apple/swift#3922 (aka apple/swift@f42158b). apple/swift#4102 has not been reverted yet. |
Comment by Fabian Ehrentraud (JIRA) Will this fix SR-2135 too? |
I implemented this on master in this PR: #6133 |
Comment by Raphael (JIRA) It is not clear to me from the SE if |
@reitzig (JIRA User): I think it would be an error in |
Comment by Raphael (JIRA) @benrimmington I don't see how links 2,3 are related? I see that the issue would be to distinguish In particular, {{{ (x,y,z) in ... } }} should never match a multi-parameter function type. If I understand correctly, currently both literals would infer to the multi-parameter type, which causes the confusion and, I daresay, inconsistency. |
You're proposing two changes:
|
Comment by Raphael (JIRA) I guess I am. One could be ambitious and propose general destructuring (similar to Scala). By using a keyword, backwards-compatibility and unambiguity could be achieved. Example: I'm not sure which Swift types can be destructured. In addition to typles, enums probably, but that would make little sense in a closure parameter list, except if we could move the case there: |
Mark Lacey has merged:
|
Additional Detail from JIRA
md5: 83ce6240317526d0237e3fdd515173d3
relates to:
Issue Description:
SE-0110 has been accepted, we just need an implementation!
https://github.com/apple/swift-evolution/blob/master/proposals/0110-distingish-single-tuple-arg.md
The text was updated successfully, but these errors were encountered: