-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[Sema] ban multi-arguments to tuple coercion #3895
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
746f067 to
9939388
Compare
|
@swift-ci test |
|
the Foundation build failure has been addressed in this PR: swiftlang/swift-corelibs-foundation#497 |
|
Nice! AFAICT we can use this patch to sniff out problems in the dependencies first and merge this after they're fixed, right? |
|
@CodaFi correct. I've done so with Foundation and XCTest. |
|
Has this been tested against lldb, swift-playgroundlogger, and swiftpm? |
|
@CodaFi ran test on lldb, got this. Are the unexpected success normal? |
|
I'm not sure about the tests, but that it builds is a positive sign WRT this patch. |
|
swiftpm changes: swiftlang/swift-package-manager#581 |
|
And a quick rebase please. |
|
@CodaFi I tried to test playground logger with |
Implements part of SE-0110. Single argument in closures will not be accepted if
there exists explicit type with a number of arguments that's not 1.
```swift
let f: (Int, Int) -> Void = { x in } // this is now an error
```
Note there's a second part of SE-0110 which could be considered additive,
which says one must add an extra pair of parens to specify a single arugment
type that is a tuple:
```swift
let g ((Int, Int)) -> Void = { y in } // y should have type (Int, Int)
```
This patch does not implement that part.
|
@CodaFi rebased |
./swift/utils/build-script --playgroundlogger <FURTHER-OPTIONS>Should do it. |
|
@CodaFi Thanks! playgroundlogger is in good shape. No change needed. |
|
The Swift changes look fantastic; thanks for pushing this through! |
|
Here's lldb test results ran on master. I think the unexpected success is part of the deal (except the count is different?) |
|
You don't have to worry about that here. What I meant was more that there are test cases inside LLDB that run swift code that may need migration. But if the suite builds without hard compiler errors then your job is done. |
|
@swift-ci please smoke test. |
|
@swift-ci please smoke test OS X |
|
the ErrorProtocol issue is something I need to investigate; re-running tests. |
|
@DougGregor Can you disable that test using a requires while you investigate? |
|
This caused a pretty serious regression. We no longer type-check this: |
would work, no? |
|
It shouldn't work. The element type is (Int, Int), and we should be passing that as a single argument to the closure, not splatting it out to two arguments. |
|
It's probably falling into the "second part of SE-0110" that isn't yet implemented. It might be that we simple cannot separate the two parts. |
|
I see. Let's revert this then. |
|
I'll work on the second part tonight. |
This commit built upon the work of Pull Request 3895. Apart from the
work to make the following work
```swift
let f: (Int, Int) -> Void = { x in } // this is now an error
```
This patch also implement the part 2 mentioned in the swiftlang#3895
```swift
let g: ((Int, Int)) -> Void = { y in } // y should have type (Int, Int)
```
What's in this pull request?
Implements part of SE-0110. Single argument in closures will not be accepted if
there exists explicit type with a number of arguments that's not 1.
Note there's a second part of SE-0110 which could be considered additive,
which says one must add an extra pair of parens to specify a single arugment
type that is a tuple:
This patch does not implement that part.
Edit:
Updates for Foundation, XCTest and SwiftPM:
swiftlang/swift-corelibs-foundation#497
swiftlang/swift-corelibs-xctest#149
swiftlang/swift-package-manager#581
Resolved bug number: (SR-2008, partial)
Before merging this pull request to apple/swift repository:
Triggering Swift CI
The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:
Smoke Testing
A smoke test on macOS does the following:
device standard libraries are not built.
version of these tests are not run.
A smoke test on Linux does the following:
tests are not run.
Validation Testing
Lint Testing
Note: Only members of the Apple organization can trigger swift-ci.