From e782e6b0b1a37a38ef2b5bf52e9b19093e8e3e3a Mon Sep 17 00:00:00 2001 From: Ben Barham Date: Fri, 23 May 2025 17:27:57 -0700 Subject: [PATCH] Add a `SendableMetatype` conformance to `Macro` `Macro.Type` is used in various `Error`s and since SE-0470, needs to conform to `SendableMetatype`. (cherry picked from commit 0efe93161ae29830b57fd82317bbf697ae99cf9f) --- Sources/SwiftSyntaxMacros/MacroProtocols/Macro.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Sources/SwiftSyntaxMacros/MacroProtocols/Macro.swift b/Sources/SwiftSyntaxMacros/MacroProtocols/Macro.swift index 6203a6f9127..3045b364475 100644 --- a/Sources/SwiftSyntaxMacros/MacroProtocols/Macro.swift +++ b/Sources/SwiftSyntaxMacros/MacroProtocols/Macro.swift @@ -10,9 +10,18 @@ // //===----------------------------------------------------------------------===// +#if compiler(>=6.2) +/// Describes a macro. +public protocol Macro: SendableMetatype { + /// How the resulting expansion should be formatted, `.auto` by default. + /// Use `.disabled` for the expansion to be used as is. + static var formatMode: FormatMode { get } +} +#else /// Describes a macro. public protocol Macro { /// How the resulting expansion should be formatted, `.auto` by default. /// Use `.disabled` for the expansion to be used as is. static var formatMode: FormatMode { get } } +#endif