Skip to content

Commit 81f9396

Browse files
committed
Accept a String for the expression in FunctionCallExpr(calledExpression:) convenience initializer
1 parent d49ea0a commit 81f9396

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/SwiftSyntaxBuilder/ConvenienceInitializers.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,15 @@ extension FunctionCallExpr {
9696
/// instead of having to wrap them in a `TupleExprElementList`.
9797
/// The presence of the parenthesis will be inferred based on the presence of arguments and the trailing closure.
9898
public init(
99-
calledExpression: ExprSyntaxProtocol,
99+
calledExpression: String,
100100
trailingClosure: ClosureExprSyntax? = nil,
101101
additionalTrailingClosures: MultipleTrailingClosureElementList? = nil,
102102
@TupleExprElementListBuilder argumentList: () -> TupleExprElementList = { [] }
103103
) {
104104
let argumentList = argumentList()
105105
let shouldOmitParens = argumentList.isEmpty && trailingClosure != nil
106106
self.init(
107-
calledExpression: calledExpression,
107+
calledExpression: Expr(calledExpression),
108108
leftParen: shouldOmitParens ? nil : .leftParen,
109109
argumentList: argumentList,
110110
rightParen: shouldOmitParens ? nil : .rightParen,

0 commit comments

Comments
 (0)