New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accessor Macros applied to properties with trailing trivia comments lead to Swift that fails to compile. #2614
Labels
bug
Something isn't working
Comments
Tracked in Apple’s issue tracker as rdar://126880983 |
Just to confirm: This is only an issue for |
@ahoppen Correct. Here is a diff that compiles a playground and passes tests:
|
OK, thanks for confirming. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
The following Swift code fails to compile:
The trailing trivia comment captures the opening round brace… which leads to the compiler error.
We can attach an accessor macro to a variable declaration with similar trailing trivia:
Which expands to:
Maybe we should do something about that comment trivia… could we place the comment trivia after (to the right of) the opening curly brace?
Could we enclose the trailing trivia with asterisks?
Steps to Reproduce
Here is a diff on
swift-syntax
to repro:The text was updated successfully, but these errors were encountered: