Skip to content

[SwiftSyntaxBuilder] Add support for control flow statements in result builders #304

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
Aug 25, 2021

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Aug 25, 2021

Add the buildOptional etc. result builder constructs to add support for control-flow constructs inside the result builders.

CC: @czechboy0

…t builders

Add the `buildOptional` etc. result builder constructs to add support for control-flow constructs inside the result builders.
@ahoppen ahoppen requested a review from akyrtzi August 25, 2021 16:19
@ahoppen
Copy link
Member Author

ahoppen commented Aug 25, 2021

@swift-ci Please test

Copy link
Contributor

@akyrtzi akyrtzi left a comment

Choose a reason for hiding this comment

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

Nice!

@ahoppen ahoppen merged commit ad768ea into swiftlang:main Aug 25, 2021
@ahoppen ahoppen deleted the pr/control-flow-result-builders branch August 25, 2021 19:17
adevress pushed a commit to adevress/swift-syntax that referenced this pull request Jan 14, 2024
…are true:

*   It is the type of a variable (file-, function-, or type-scoped)
*   It is mutable (`var`, not `let`)
*   It is not a computed property
*   It does not have an initializer expression

If all of these are true, shortening it to `T?` would introduce a useless
nil-initialization that can be problematic in situations that want to
optimize performance (see https://forums.swift.org/t/what-is-a-variable-initialization-expression/52132).

Fixes swiftlang#304.
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