Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions test/Macros/Inputs/syntax_macro_definitions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ public struct ColorLiteralMacro: ExpressionMacro {
of: macro.argumentList, with: "_colorLiteralRed"
)
let initSyntax: ExprSyntax = ".init(\(argList))"
if let leadingTrivia = macro.leadingTrivia {
return initSyntax.with(\.leadingTrivia, leadingTrivia)
}
return initSyntax
return initSyntax.with(\.leadingTrivia, macro.leadingTrivia)
}
}

Expand All @@ -48,10 +45,7 @@ public struct FileIDMacro: ExpressionMacro {
}

let fileLiteral: ExprSyntax = "\(literal: fileID)"
if let leadingTrivia = macro.leadingTrivia {
return fileLiteral.with(\.leadingTrivia, leadingTrivia)
}
return fileLiteral
return fileLiteral.with(\.leadingTrivia, macro.leadingTrivia)
}
}

Expand Down