@@ -137,7 +137,7 @@ private final class _ContextInserter<C, M>: SyntaxRewriter where C: MacroExpansi
137
137
///
138
138
/// - Returns: A rewritten copy of `node` that calls into the expression
139
139
/// context when it is evaluated at runtime.
140
- private func _rewrite< E > ( _ node: E , originalWas originalNode: some SyntaxProtocol , calling functionName: TokenSyntax ? = nil , passing additionalArguments: [ Argument ] = [ ] ) -> ExprSyntax where E : ExprSyntaxProtocol {
140
+ private func _rewrite( _ node: some ExprSyntaxProtocol , originalWas originalNode: some ExprSyntaxProtocol , calling functionName: TokenSyntax ? = nil , passing additionalArguments: [ Argument ] = [ ] ) -> ExprSyntax {
141
141
guard rewrittenNodes. insert ( Syntax ( originalNode) ) . inserted else {
142
142
// If this node has already been rewritten, we don't need to rewrite it
143
143
// again. (Currently, this can only happen when expanding binary operators
@@ -196,7 +196,7 @@ private final class _ContextInserter<C, M>: SyntaxRewriter where C: MacroExpansi
196
196
/// context when it is evaluated at runtime.
197
197
///
198
198
/// This function is equivalent to `_rewrite(node, originalWas: node)`.
199
- private func _rewrite< E > ( _ node: E , calling functionName: TokenSyntax ? = nil , passing additionalArguments: [ Argument ] = [ ] ) -> ExprSyntax where E : ExprSyntaxProtocol {
199
+ private func _rewrite( _ node: some ExprSyntaxProtocol , calling functionName: TokenSyntax ? = nil , passing additionalArguments: [ Argument ] = [ ] ) -> ExprSyntax {
200
200
_rewrite ( node, originalWas: node, calling: functionName, passing: additionalArguments)
201
201
}
202
202
@@ -423,7 +423,7 @@ private final class _ContextInserter<C, M>: SyntaxRewriter where C: MacroExpansi
423
423
/// the original syntax tree.
424
424
///
425
425
/// - Returns: A function call expression equivalent to the described cast.
426
- private func _rewriteAsCast( _ valueExpr: ExprSyntax , _ isAsKeyword: Keyword , _ type: TypeSyntax , originalWas originalNode: some SyntaxProtocol ) -> ExprSyntax {
426
+ private func _rewriteAsCast( _ valueExpr: ExprSyntax , _ isAsKeyword: Keyword , _ type: TypeSyntax , originalWas originalNode: some ExprSyntaxProtocol ) -> ExprSyntax {
427
427
rewrittenNodes. insert ( Syntax ( type) )
428
428
429
429
return _rewrite (
0 commit comments