You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/SwiftSyntaxMacroExpansion/MacroReplacement.swift
+51-2Lines changed: 51 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,7 @@ public enum MacroDefinition {
58
58
/// defining macro. These subtrees will need to be replaced with the text of
59
59
/// the corresponding argument to the macro, which can be accomplished with
60
60
/// `MacroDeclSyntax.expandDefinition`.
61
-
case expansion(MacroExpansionExprSyntax, replacements:[Replacement])
61
+
case expansion(MacroExpansionExprSyntax, replacements:[Replacement], genericReplacements:[GenericArgumentReplacement]) // FIXME: do we need to evolve this without breaking? I assume so?
62
62
}
63
63
64
64
extensionMacroDefinition{
@@ -70,11 +70,21 @@ extension MacroDefinition {
70
70
/// The index of the parameter in the defining macro.
71
71
publicletparameterIndex:Int
72
72
}
73
+
74
+
/// A replacement that occurs as part of an expanded macro definition.
75
+
publicstructGenericArgumentReplacement{
76
+
/// A reference to a parameter as it occurs in the macro expansion expression.
77
+
publicletreference:GenericArgumentSyntax
78
+
79
+
/// The index of the parameter in the defining macro.
0 commit comments