@@ -25,8 +25,19 @@ public protocol MacroExpansionContext: AnyObject {
2525 ///
2626 /// - Returns: an identifier token containing a unique name that will not
2727 /// conflict with any other name in a well-formed program.
28+ @available ( * , renamed: " makeUniqueName(_:) " )
2829 func createUniqueName( _ name: String ) -> TokenSyntax
2930
31+ /// Generate a unique name for use in the macro.
32+ ///
33+ /// - Parameters:
34+ /// - name: The name to use as a basis for the uniquely-generated name,
35+ /// which will appear in the unique name that's produced here.
36+ ///
37+ /// - Returns: an identifier token containing a unique name that will not
38+ /// conflict with any other name in a well-formed program.
39+ func makeUniqueName( _ name: String ) -> TokenSyntax
40+
3041 /// Produce a diagnostic while expanding the macro.
3142 func diagnose( _ diagnostic: Diagnostic )
3243
@@ -137,6 +148,31 @@ extension MacroExpansionContext {
137148 column: " \( literal: column) "
138149 )
139150 }
151+
152+ /// Generate a unique name for use in the macro.
153+ ///
154+ /// - Parameters:
155+ /// - name: The name to use as a basis for the uniquely-generated name,
156+ /// which will appear in the unique name that's produced here.
157+ ///
158+ /// - Returns: an identifier token containing a unique name that will not
159+ /// conflict with any other name in a well-formed program.
160+ @available ( * , renamed: " makeUniqueName(_:) " )
161+ public func createUniqueName( _ name: String ) -> TokenSyntax {
162+ makeUniqueName ( name)
163+ }
164+
165+ /// Generate a unique name for use in the macro.
166+ ///
167+ /// - Parameters:
168+ /// - name: The name to use as a basis for the uniquely-generated name,
169+ /// which will appear in the unique name that's produced here.
170+ ///
171+ /// - Returns: an identifier token containing a unique name that will not
172+ /// conflict with any other name in a well-formed program.
173+ public func makeUniqueName( _ name: String ) -> TokenSyntax {
174+ createUniqueName ( name)
175+ }
140176}
141177
142178/// Diagnostic message used for thrown errors.
0 commit comments