Skip to content

Commit ec41bd6

Browse files
committed
[ExamplePlugin] Update the 'expansion' witness for SendableExtensionMacro to
add the 'conformingTo' parameter.
1 parent adb044e commit ec41bd6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Examples/Sources/ExamplePlugin/Macros.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,13 @@ public struct SendableExtensionMacro: ExtensionMacro {
9191
of node: AttributeSyntax,
9292
attachedTo: some DeclGroupSyntax,
9393
providingExtensionsOf type: some TypeSyntaxProtocol,
94+
conformingTo protocols: [TypeSyntax],
9495
in context: some MacroExpansionContext
9596
) throws -> [ExtensionDeclSyntax] {
97+
if protocols.isEmpty {
98+
return []
99+
}
100+
96101
let sendableExtension: DeclSyntax =
97102
"""
98103
extension \(type.trimmed): Sendable {}

0 commit comments

Comments
 (0)