Skip to content

Commit e2edfab

Browse files
authored
Merge pull request #2225 from Matejkob/fix-raw-syntax-validation
Replace text `"async"` with `keyword(.async)` in macro examples
2 parents b2cbece + 98a02af commit e2edfab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Examples/Sources/MacroExamples/Implementation/Peer/AddCompletionHandlerMacro.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ public struct AddCompletionHandlerMacro: PeerMacro {
3333
if funcDecl.signature.effectSpecifiers?.asyncSpecifier == nil {
3434
let newEffects: FunctionEffectSpecifiersSyntax
3535
if let existingEffects = funcDecl.signature.effectSpecifiers {
36-
newEffects = existingEffects.with(\.asyncSpecifier, "async ")
36+
newEffects = existingEffects.with(\.asyncSpecifier, .keyword(.async))
3737
} else {
38-
newEffects = FunctionEffectSpecifiersSyntax(asyncSpecifier: "async ")
38+
newEffects = FunctionEffectSpecifiersSyntax(asyncSpecifier: .keyword(.async))
3939
}
4040

4141
let newSignature = funcDecl.signature.with(\.effectSpecifiers, newEffects)

0 commit comments

Comments
 (0)