Skip to content

Commit 0d1e482

Browse files
ZevEisenbergjamieQ
authored andcommitted
[Observation] fix bug where a comment in an annotation would result in invalid macro expansion. The comment was 'eating' the generated variable declaration, preventing it from being visible to the compiler.
1 parent aca07fb commit 0d1e482

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Macros/Sources/ObservationMacros/ObservableMacro.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ extension VariableDeclSyntax {
283283
leadingTrivia: leadingTrivia,
284284
attributes: newAttributes,
285285
modifiers: modifiers.privatePrefixed(prefix, in: context),
286-
bindingSpecifier: TokenSyntax(bindingSpecifier.tokenKind, leadingTrivia: .space, trailingTrivia: .space, presence: .present),
286+
bindingSpecifier: TokenSyntax(bindingSpecifier.tokenKind, leadingTrivia: .newline, trailingTrivia: .space, presence: .present),
287287
bindings: bindings.privatePrefixed(prefix, in: context),
288288
trailingTrivia: trailingTrivia
289289
)

0 commit comments

Comments
 (0)