Skip to content

Commit ca60687

Browse files
committed
Put back the closure synthesis in __cmp
1 parent 35aa479 commit ca60687

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Sources/TestingMacros/Support/ConditionArgumentParsing.swift

+9-1
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,15 @@ private final class _ContextInserter<C, M>: SyntaxRewriter where C: MacroExpansi
429429
op == "==" || op == "!=" || op == "===" || op == "!==" {
430430

431431
return _rewrite(
432-
DeclReferenceExprSyntax(baseName: .binaryOperator(op)),
432+
ClosureExprSyntax {
433+
InfixOperatorExprSyntax(
434+
leftOperand: DeclReferenceExprSyntax(baseName: .dollarIdentifier("$0"))
435+
.with(\.trailingTrivia, .space),
436+
operator: BinaryOperatorExprSyntax(text: op),
437+
rightOperand: DeclReferenceExprSyntax(baseName: .dollarIdentifier("$1"))
438+
.with(\.leadingTrivia, .space)
439+
)
440+
},
433441
originalWas: node,
434442
calling: .identifier("__cmp"),
435443
passing: [

0 commit comments

Comments
 (0)