Skip to content

[Macros] Don't allow macros to add accessors to let variables. #73878

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

Merged
merged 1 commit into from
May 24, 2024

Conversation

hborla
Copy link
Member

@hborla hborla commented May 24, 2024

let declarations cannot be computed properties, and accessor macros are currently allowed to bypass this rule. This was accidental, so this change diagnoses expanded accessors on a let variable as an invalid macro expansion.

Resolves: rdar://122690037, swiftlang/swift-syntax#2491

@hborla
Copy link
Member Author

hborla commented May 24, 2024

@swift-ci please smoke test

@hborla hborla force-pushed the invalid-accessor-macro branch from 8aec86d to 3c6918a Compare May 24, 2024 05:22
@hborla
Copy link
Member Author

hborla commented May 24, 2024

@swift-ci please smoke test

@hborla hborla merged commit 1ffc6b7 into swiftlang:main May 24, 2024
3 checks passed
@hborla hborla deleted the invalid-accessor-macro branch May 24, 2024 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant