Skip to content

Build AddCompletionHandler body as CodeBlockSyntax#3336

Open
broken-circle wants to merge 1 commit into
swiftlang:mainfrom
broken-circle:addcompletionhandler-body
Open

Build AddCompletionHandler body as CodeBlockSyntax#3336
broken-circle wants to merge 1 commit into
swiftlang:mainfrom
broken-circle:addcompletionhandler-body

Conversation

@broken-circle

@broken-circle broken-circle commented May 16, 2026

Copy link
Copy Markdown
Contributor

The AddCompletionHandler peer macro in PeerMacroTests had a FIXME noting that CodeBlockSyntax should be made ExpressibleByStringInterpolation so the synthesized function body could be written directly. That conformance exists today, so this PR resolves the FIXME by building the body as a CodeBlockSyntax literal and assigning it directly, instead of parsing an ExprSyntax and wrapping it via CodeBlockSyntax { newBody }.

`CodeBlockSyntax` now conforms to `SyntaxExpressibleByStringInterpolation`,
so build the synthesized function body directly as a `CodeBlockSyntax`
literal rather than parsing an `ExprSyntax` and wrapping it.
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.

1 participant