Skip to content

Commit

Permalink
Put back the closure synthesis in __cmp
Browse files Browse the repository at this point in the history
  • Loading branch information
grynspan committed Jan 22, 2025
1 parent 35aa479 commit ca60687
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Sources/TestingMacros/Support/ConditionArgumentParsing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,15 @@ private final class _ContextInserter<C, M>: SyntaxRewriter where C: MacroExpansi
op == "==" || op == "!=" || op == "===" || op == "!==" {

return _rewrite(
DeclReferenceExprSyntax(baseName: .binaryOperator(op)),
ClosureExprSyntax {
InfixOperatorExprSyntax(
leftOperand: DeclReferenceExprSyntax(baseName: .dollarIdentifier("$0"))
.with(\.trailingTrivia, .space),
operator: BinaryOperatorExprSyntax(text: op),
rightOperand: DeclReferenceExprSyntax(baseName: .dollarIdentifier("$1"))
.with(\.leadingTrivia, .space)
)
},
originalWas: node,
calling: .identifier("__cmp"),
passing: [
Expand Down

0 comments on commit ca60687

Please sign in to comment.