Skip to content

In Swift 3 mode, allow "tuple unsplatting" in certain cases. #7102

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
merged 1 commit into from
Jan 27, 2017

Conversation

jrose-apple
Copy link
Contributor

  • Explanation: Swift 3.0 allowed constructing an enum or calling a function-typed property with multiple arguments even when a single argument of tuple type was expected. Emulate that in Swift 3 mode by wrapping in an extra level of parentheses when the situation comes up.
  • Scope: Affects tuple arguments passed to single, non-tuple parameters that happen to be generic.
  • Issue: rdar://problem/30171399
  • Reviewed by: @slavapestov, @DougGregor
  • Risk: Low. The limited scope means this won't affect many people at all.
  • Testing: Added compiler regression tests.

…ng#7077)

Swift 3.0 allowed constructing an enum or calling a function-typed
property with multiple arguments even when a single argument of tuple
type was expected. Emulate that in Swift 3 mode by wrapping in an
extra level of parentheses when the situation comes up.

Last vestiges of fallout from SE-0110. Hopefully last, anyway. A nice
follow-up to this commit might be to /warn/ in Swift 3 mode when this
happens.

rdar://problem/30171399
@jrose-apple jrose-apple added this to the Swift 3.1 milestone Jan 27, 2017
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 9d642b0
Test requested by - @jrose-apple

@jrose-apple
Copy link
Contributor Author

jrose-apple commented Jan 27, 2017

I think Erik's fixed this—the super.sil failure from earlier.

@swift-ci Please test macOS

@ematejska ematejska merged commit 6bca9f7 into swiftlang:swift-3.1-branch Jan 27, 2017
@jrose-apple jrose-apple deleted the 3.1-unsplat branch January 27, 2017 23:40
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.

3 participants