Skip to content
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

[Function builders] Additional entry points #30322

Merged
merged 2 commits into from
Mar 11, 2020

Conversation

DougGregor
Copy link
Member

Introduce two new function builder entry points:

  • buildFinalResult, to build the final result of the function builder transformation in the synthesized return
  • buildOptional, as an alternative name for buildIf that matches up with the proposal

When present in a function builder, buildFinalResult() will be called on
the value of the outermost block to form the final result of the closure.
This allows one to collapse the full function builder computation into
a single result without having to do it in each buildBlock() call.
Line up with the function builders pitch, which uses buildOptional(_:)
to build optional values.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor DougGregor merged commit a3979da into apple:master Mar 11, 2020
@DougGregor DougGregor deleted the function-builders-extras branch March 11, 2020 23:17
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.

None yet

1 participant