@@ -23,14 +23,13 @@ public enum _DebugDescriptionPropertyMacro {}
23
23
/// The job of conversion is split across two macros. This macro performs some analysis on the attached
24
24
/// type, and then delegates to `@_DebugDescriptionProperty` to perform the conversion step.
25
25
extension DebugDescriptionMacro : MemberAttributeMacro {
26
- public static func expansion< DeclGroup , DeclSyntax , Context > (
26
+ public static func expansion(
27
27
of node: AttributeSyntax ,
28
- attachedTo declaration: DeclGroup ,
29
- providingAttributesFor member: DeclSyntax ,
30
- in context: Context
28
+ attachedTo declaration: some DeclGroupSyntax ,
29
+ providingAttributesFor member: some DeclSyntaxProtocol ,
30
+ in context: some MacroExpansionContext
31
31
)
32
32
throws -> [ AttributeSyntax ]
33
- where DeclGroup: DeclGroupSyntax , DeclSyntax: DeclSyntaxProtocol , Context: MacroExpansionContext
34
33
{
35
34
guard !declaration. is ( ProtocolDeclSyntax . self) else {
36
35
let message : ErrorMessage = " cannot be attached to a protocol "
@@ -119,13 +118,12 @@ extension DebugDescriptionMacro: MemberAttributeMacro {
119
118
///
120
119
/// See https://lldb.llvm.org/use/variable.html#type-summary
121
120
extension _DebugDescriptionPropertyMacro : PeerMacro {
122
- public static func expansion< Decl , Context > (
121
+ public static func expansion(
123
122
of node: AttributeSyntax ,
124
- providingPeersOf declaration: Decl ,
125
- in context: Context
123
+ providingPeersOf declaration: some DeclSyntaxProtocol ,
124
+ in context: some MacroExpansionContext
126
125
)
127
126
throws -> [ DeclSyntax ]
128
- where Decl: DeclSyntaxProtocol , Context: MacroExpansionContext
129
127
{
130
128
guard let arguments = node. arguments else {
131
129
// Assertion as a diagnostic.
@@ -346,7 +344,7 @@ extension MacroExpansionContext {
346
344
extension MacroExpansionContext {
347
345
/// Determine the module name of the Syntax node, via its fileID.
348
346
/// See https://developer.apple.com/documentation/swift/fileid()
349
- fileprivate func moduleName< T : SyntaxProtocol > ( of node: T ) -> String ? {
347
+ fileprivate func moduleName( of node: some SyntaxProtocol ) -> String ? {
350
348
if let fileID = self . location ( of: node) ? . file. as ( StringLiteralExprSyntax . self) ? . representedLiteralValue,
351
349
let firstSlash = fileID. firstIndex ( of: " / " ) {
352
350
return String ( fileID. prefix ( upTo: firstSlash) )
0 commit comments