Skip to content

Commit ab727c9

Browse files
committed
Fix a bug that caused incorrect debugInitCall output
This was caused by the latest SwiftSyntaxBuilder API update
1 parent 3a352ac commit ab727c9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Sources/_SwiftSyntaxTestSupport/SyntaxProtocol+Initializer.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ private extension TriviaPiece {
6262
let (label, value) = Mirror(reflecting: self).children.first!
6363
switch value {
6464
case let value as String:
65-
return FunctionCallExpr(calledExpression: MemberAccessExpr(name: label!)) {
65+
return FunctionCallExpr(callee: ".\(label!)") {
6666
TupleExprElement(expression: StringLiteralExpr(content: value))
6767
}
6868
case let value as Int:
69-
return FunctionCallExpr(calledExpression: MemberAccessExpr(name: label!)) {
69+
return FunctionCallExpr(callee: ".\(label!)") {
7070
TupleExprElement(expression: IntegerLiteralExpr(value))
7171
}
7272
default:
@@ -106,7 +106,7 @@ extension SyntaxProtocol {
106106
private var debugInitCallExpr: ExprSyntaxProtocol {
107107
let mirror = Mirror(reflecting: self)
108108
if self.isCollection {
109-
return FunctionCallExpr(calledExpression: IdentifierExpr(String("\(type(of: self))"))) {
109+
return FunctionCallExpr(callee: "\(type(of: self))") {
110110
TupleExprElement(
111111
expression: ArrayExpr() {
112112
for child in mirror.children {
@@ -131,7 +131,7 @@ extension SyntaxProtocol {
131131
tokenInitializerName = String(tokenKindStr[..<tokenKindStr.firstIndex(of: "(")!])
132132
requiresExplicitText = true
133133
}
134-
return FunctionCallExpr(calledExpression: MemberAccessExpr(name: tokenInitializerName)) {
134+
return FunctionCallExpr(callee: ".\(tokenInitializerName)") {
135135
if requiresExplicitText {
136136
TupleExprElement(
137137
expression: StringLiteralExpr(content: token.text)
@@ -160,7 +160,7 @@ extension SyntaxProtocol {
160160
}
161161
}
162162
} else {
163-
return FunctionCallExpr(calledExpression: IdentifierExpr(String("\(type(of: self))"))) {
163+
return FunctionCallExpr(callee: "\(type(of: self))") {
164164
for child in mirror.children {
165165
let label = child.label!
166166
let value = child.value as! SyntaxProtocol?

0 commit comments

Comments
 (0)