@@ -141,6 +141,7 @@ extension FloatLiteralExprSyntax: ExpressibleByFloatLiteral {
141
141
// MARK: - FunctionCallExpr
142
142
143
143
extension FunctionCallExpr {
144
+ // Need an overload that's explicitly `ExprSyntax` for code literals to work.
144
145
/// A convenience initializer that allows passing in arguments using a result builder
145
146
/// instead of having to wrap them in a `TupleExprElementList`.
146
147
/// The presence of the parenthesis will be inferred based on the presence of arguments and the trailing closure.
@@ -161,6 +162,23 @@ extension FunctionCallExpr {
161
162
additionalTrailingClosures: additionalTrailingClosures
162
163
)
163
164
}
165
+
166
+ /// A convenience initializer that allows passing in arguments using a result builder
167
+ /// instead of having to wrap them in a `TupleExprElementList`.
168
+ /// The presence of the parenthesis will be inferred based on the presence of arguments and the trailing closure.
169
+ public init (
170
+ callee: ExprSyntaxProtocol ,
171
+ trailingClosure: ClosureExprSyntax ? = nil ,
172
+ additionalTrailingClosures: MultipleTrailingClosureElementList ? = nil ,
173
+ @TupleExprElementListBuilder argumentList: ( ) -> TupleExprElementList = { [ ] }
174
+ ) {
175
+ self . init (
176
+ callee: ExprSyntax ( fromProtocol: callee) ,
177
+ trailingClosure: trailingClosure,
178
+ additionalTrailingClosures: additionalTrailingClosures,
179
+ argumentList: argumentList
180
+ )
181
+ }
164
182
}
165
183
166
184
// MARK: - FunctionParameter
0 commit comments