@@ -139,7 +139,7 @@ import SwiftSyntax
139139 case implicit( ImplicitDecl )
140140 /// Dollar identifier introduced by a closure without parameters.
141141 case dollarIdentifier( ClosureExprSyntax , strRepresentation: String )
142- /// Represents equivalent identifiers grouped together.
142+ /// Represents equivalent names grouped together.
143143 /// - Important: The array should be non-empty.
144144 ///
145145 /// ### Example:
@@ -150,8 +150,8 @@ import SwiftSyntax
150150 /// }
151151 /// ```
152152 /// For lookup at the given position, the result
153- /// contains only one (composite) name
154- case compositeName ( [ LookupName ] )
153+ /// contains only one name, that represents both `let x` declarations.
154+ case equivalentNames ( [ LookupName ] )
155155
156156 /// Syntax associated with this name.
157157 @_spi ( Experimental) public var syntax : SyntaxProtocol {
@@ -164,7 +164,7 @@ import SwiftSyntax
164164 return implicitName. syntax
165165 case . dollarIdentifier( let closureExpr, _) :
166166 return closureExpr
167- case . compositeName ( let names) :
167+ case . equivalentNames ( let names) :
168168 return names. first!. syntax
169169 }
170170 }
@@ -180,7 +180,7 @@ import SwiftSyntax
180180 return kind. identifier
181181 case . dollarIdentifier( _, strRepresentation: _) :
182182 return nil
183- case . compositeName ( let names) :
183+ case . equivalentNames ( let names) :
184184 return names. first!. identifier
185185 }
186186 }
@@ -202,7 +202,7 @@ import SwiftSyntax
202202 return implicitName. position
203203 case . dollarIdentifier( let closureExpr, _) :
204204 return closureExpr. positionAfterSkippingLeadingTrivia
205- case . compositeName ( let names) :
205+ case . equivalentNames ( let names) :
206206 return names. first!. position
207207 }
208208 }
@@ -338,20 +338,8 @@ import SwiftSyntax
338338 return " implicit: \( strName) "
339339 case . dollarIdentifier( _, strRepresentation: let str) :
340340 return " dollarIdentifier: \( str) "
341- case . compositeName( let names) :
342- var result = " Composite name: [ "
343-
344- for (index, name) in names. enumerated ( ) {
345- result += name. debugDescription
346-
347- if index < names. count - 1 {
348- result += " , "
349- } else {
350- result += " ] "
351- }
352- }
353-
354- return result
341+ case . equivalentNames( let names) :
342+ return " Composite name: [ \( names. map ( \. debugDescription) . joined ( separator: " , " ) ) ] "
355343 }
356344 }
357345}
0 commit comments