Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions Tests/SwiftSyntaxMacroExpansionTest/PeerMacroTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,13 @@ final class PeerMacroTests: XCTestCase {
let call: ExprSyntax =
"\(funcDecl.name)(\(raw: callArguments.joined(separator: ", ")))"

// FIXME: We should make CodeBlockSyntax ExpressibleByStringInterpolation,
// so that the full body could go here.
let newBody: ExprSyntax =
let newBody: CodeBlockSyntax =
"""

{
Task {
completionHandler(await \(call))
}

}
"""

// Drop the @addCompletionHandler attribute from the new declaration.
Expand All @@ -126,7 +124,7 @@ final class PeerMacroTests: XCTestCase {
newFunc.signature.returnClause = nil // drop result type
newFunc.signature.parameterClause.parameters = newParameterList
newFunc.signature.parameterClause.trailingTrivia = []
newFunc.body = CodeBlockSyntax { newBody }
newFunc.body = newBody
newFunc.attributes = newAttributeList

return [DeclSyntax(newFunc)]
Expand Down