Skip to content

Add ExpressibleAsExprBuildable: ExpressibleAsCodeBlockItem #524

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
Jul 27, 2022

Conversation

fwcd
Copy link
Member

@fwcd fwcd commented Jul 27, 2022

Fixes #506 (comment). This patch generalizes the current conformance of ExpressibleAsFunctionCallExpr to ExpressibleAsCodeBlockItem to arbitrary expressions, thereby removing the need to wrap expressions explicitly in CodeBlockItems:

CodeBlock {
  FunctionCallExpr("print") { TupleExprElement(expression: StringLiteralExpr("Hello world")) }
  IntegerLiteralExpr(42)
  "someIdentifier"
}

This generalizes the current conformance of ExpressibleAsFunctionCallExpr
to ExpressibleAsCodeBlockItem to arbitrary expressions.
@fwcd fwcd requested a review from ahoppen as a code owner July 27, 2022 14:58
@fwcd
Copy link
Member Author

fwcd commented Jul 27, 2022

@swift-ci please test

@fwcd fwcd merged commit 5b5383c into swiftlang:main Jul 27, 2022
@fwcd fwcd deleted the expr-expressible-as-code-block-item branch July 27, 2022 16:05
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