Skip to content

Roll back a portion of SE-0110 #10027

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
Jun 20, 2017
Merged

Roll back a portion of SE-0110 #10027

merged 1 commit into from
Jun 20, 2017

Conversation

rudkx
Copy link
Contributor

@rudkx rudkx commented Jun 1, 2017

As described in:

https://lists.swift.org/pipermail/swift-evolution-announce/2017-June/000386.html

Specifically allow an N-ary argument function to be passed as an
argument in a place where a function of a single N-tuple is expected.

Fixes: rdar://problem/32875953

@rudkx
Copy link
Contributor Author

rudkx commented Jun 1, 2017

@swift-ci Please smoke test

@rudkx
Copy link
Contributor Author

rudkx commented Jun 1, 2017

@swift-ci Please test source compatibility

@rudkx
Copy link
Contributor Author

rudkx commented Jun 1, 2017

@slavapestov @rjmccall I still need to make another pass over the tests to see if I need to add additional tests, see if the behavior when generics are involved makes sense, and fixup a couple migrator tests, but so far this seems like a reasonable way to allow a very narrow exception to get back some of the usability of closures that accept multiple arguments being used in places that expect to call closures that except a tuple.

@rudkx
Copy link
Contributor Author

rudkx commented Jun 1, 2017

@bitjammer Have you seen this assertion failure in the migrator code before? I would expect that some errors & fixits would no longer be present as a result of my changes, but not that the migrator code would run into assertions as a result.

Command Output (stderr):
--
/Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/swift/test/Migrator/Inputs/never_compiles_safely_exits_breaking_code.swift:1:15: warning: when calling this function in Swift 4 or later, you must pass a '()' tuple; did you mean for the input type to be '()'?
func foo(_ f: (Void) -> ()) {}
              ^~~~~~
              ()
Assertion failed: (FD >= 0 && "File not yet open!"), function preferred_buffer_size, file /Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/llvm/lib/Support/raw_ostream.cpp, line 624.

@bitjammer
Copy link
Contributor

Yes, that means that (usually) we forgot to make the destination directory for the migrated swift or remap file. I'm guessing you made something compile that didn't before? That's why the test is continuing on into the migrator and emitting migrated contents. I think that test will need to be updated to some other code that can't compile (and doesn't have proactive fix-its that the migrator can try to pick up before actually doing the migration).

@bitjammer
Copy link
Contributor

To be clear, the test is not supposed to rm -rf/mkdir because it's not supposed to make it to emitted migrated stuff. It just needs to be updating to something else that still doesn't compile.

@rudkx
Copy link
Contributor Author

rudkx commented Jun 9, 2017

@swift-ci Please smoke test

@rudkx
Copy link
Contributor Author

rudkx commented Jun 9, 2017

@swift-ci Please test source compatibility

1 similar comment
@rudkx
Copy link
Contributor Author

rudkx commented Jun 13, 2017

@swift-ci Please test source compatibility

@slavapestov
Copy link
Contributor

I'd rather we did this by going back to the Swift 3.1 behavior instead of adding new unproven semantics.

@slavapestov
Copy link
Contributor

Something like this: #10257

@rudkx
Copy link
Contributor Author

rudkx commented Jun 14, 2017

@bitjammer David, my change here backs out 726adfb because it no longer seems necessary with this update to the type checker since we no longer emit that fixit for these cases. I also updated never_compiles_safely_exits_breaking_code.swift as a result as well, but I think that was from a different commit.

Do these look okay?

@rudkx
Copy link
Contributor Author

rudkx commented Jun 14, 2017

@swift-ci Please test source compatibility

@bitjammer
Copy link
Contributor

As long as you feel that the diagnostic won't come up in other cases which would be surprising during migration, it's fine by me if you want to remove that filter.

@rudkx
Copy link
Contributor Author

rudkx commented Jun 15, 2017

@swift-ci Please test source compatibility

1 similar comment
@rudkx
Copy link
Contributor Author

rudkx commented Jun 15, 2017

@swift-ci Please test source compatibility

@rudkx
Copy link
Contributor Author

rudkx commented Jun 17, 2017

@swift-ci Please smoke test

As described in:
  https://lists.swift.org/pipermail/swift-evolution-announce/2017-June/000386.html

Specifically allow an N-ary argument function to be passed as an
argument in a place where a function of a single N-tuple is expected.

Fixes: rdar://problem/32875953
@rudkx rudkx changed the title [WIP - DO NOT MERGE] wip: allow a very narrow function conversion Roll back a portion of SE-0110 Jun 20, 2017
@rudkx
Copy link
Contributor Author

rudkx commented Jun 20, 2017

@swift-ci Please smoke test

@rudkx rudkx merged commit 706922d into swiftlang:master Jun 20, 2017
@rudkx rudkx deleted the thread-tuple-splat-through-eyes-of-function-parameters branch June 20, 2017 19:39
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