Skip to content

Perform function conversions when converting between autoclosures #17339

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

Conversation

rjmccall
Copy link
Contributor

@rjmccall rjmccall commented Jun 19, 2018

This is correct because it's the apparent rule used by CSSimplify: value-to-autoclosure conversion is considered if and only if the input type is not an autoclosure function type.

The real solution to this problem is that @autoclosure should be tracked as a bit on the parameter type instead of as a bit on function types. Slava has a PR leading towards that (#10094), but it causes a source-compatibility problem when forwarding autoclosures. You really shouldn't be able to forward autoclosures, but that's an issue for the core team to resolve, and in the meantime there's this bug.

Fixes rdar://41219750.

This is correct because it's the apparent rule used by CSSimplify:
value-to-autoclosure conversion is considered if and only if the
input type is not an autoclosure function type.

The real solution to this problem is that @autoclosure should be tracked
as a bit on the parameter type instead of as a bit on function types.
Slava has a PR leading towards that (swiftlang#10094),
but it causes a source-compatibility problem when forwarding autoclosures.
You really shouldn't be able to forward autoclosures, but that's an
issue for the core team to resolve, and in the meantime there's this bug.

Fixes rdar://41219750.
@rjmccall
Copy link
Contributor Author

@swift-ci Please test.

@rjmccall rjmccall requested a review from slavapestov June 19, 2018 22:59
Copy link
Contributor

@slavapestov slavapestov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh :)

@rjmccall rjmccall merged commit 4660af6 into swiftlang:master Jun 20, 2018
@rjmccall rjmccall deleted the autoclosure-conversion-application branch June 20, 2018 01:37
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.

2 participants