swift-syntax
swift-syntax copied to clipboard
Macro expansions allow a space (or even newline) between `#` and macro name, as well as `@` and attribute name
Issue Kind
Other
Source Code
# myMacroName
#
myMacroName
@ MyAttribute
func foo() {}
@
MyAttribute
func foo() {}
Description
The above examples parse as macro expansion or attribute but shouldn’t be valid. We need to check that the #
or @
doesn’t contain trailing trivia and the identifier doesn’t contain leading trivia to parse a macro expansion/attribute.
rdar://106464071
@ahoppen Is it possible to assign this issue to me? I'm already working on it on my free time.
Is this still an issue?
No, this was fixed by https://github.com/apple/swift-syntax/pull/2466. Thanks for noticing 👍🏽