File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
lib/ASTGen/Sources/ASTGen Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,9 @@ extension ASTGenVisitor {
91
91
let secondName : UnsafeMutableRawPointer ?
92
92
let type : UnsafeMutableRawPointer ?
93
93
94
- if let nodeFirstName = node. firstName {
94
+ if let nodeFirstName = node. firstName,
95
+ // Swift AST represnts "_" as nil.
96
+ nodeFirstName. text != " _ " {
95
97
var text = nodeFirstName. text
96
98
firstName = text. withUTF8 { buf in
97
99
SwiftASTContext_getIdentifier ( ctx, buf. baseAddress, buf. count)
Original file line number Diff line number Diff line change @@ -64,8 +64,10 @@ extension ASTGenVisitor {
64
64
65
65
public func visit( _ node: TupleExprElementListSyntax ) -> ASTNode {
66
66
let elements = node. map { self . visit ( $0) . rawValue }
67
- let labels : [ BridgedIdentifier ] = node. enumerated ( ) . map { ( idx, e) in
68
- var name = e. label? . text ?? " \( idx) "
67
+ let labels : [ BridgedIdentifier ? ] = node. map {
68
+ guard var name = $0. label? . text else {
69
+ return nil
70
+ }
69
71
return name. withUTF8 { buf in
70
72
SwiftASTContext_getIdentifier ( ctx, buf. baseAddress, buf. count)
71
73
}
You can’t perform that action at this time.
0 commit comments