Skip to content

[Macros] Ignore the @TaskLocal macro attached to vars with projected value vars. #73832

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 23, 2024

Conversation

hborla
Copy link
Member

@hborla hborla commented May 23, 2024

VarDecls with @_projectedValueProperty have already had the property wrapper transform applied. This only impacts swiftinterfaces, and if a swiftinterface was produced against a Concurrency library that does not declare TaskLocal as a macro, we need to ignore the macro to avoid producing duplicate declarations. This is only needed temporarily until all swiftinterfaces have been built against the Concurrency library containing the new macro declaration.

Note that all of the property wrapper requests will not consider these declarations to have an attached property wrapper because the macro declaration always wins when resolving the custom attribute. I think this is okay, because the property wrapper transform has already been applied. As far as I can tell, the purpose of @_projectedValueProperty is to avoid synthesizing another projected value in the case where one has already been created.

Resolves: rdar://128542258

…d values.

VarDecls with `@_projectedValueProperty` have already had the property
wrapper transform applied. This only impacts swiftinterfaces, and if
a swiftinterface was produced against a Concurrency library that does
not declare `TaskLocal` as a macro, we need to ignore the macro to avoid
producing duplicate declarations. This is only needed temporarily until
all swiftinterfaces have been built against the Concurrency library
containing the new macro declaration.
@hborla hborla requested review from slavapestov and xedin as code owners May 23, 2024 01:07
@hborla
Copy link
Member Author

hborla commented May 23, 2024

@swift-ci please smoke test

@hborla hborla merged commit f3d4969 into swiftlang:main May 23, 2024
3 checks passed
@hborla hborla deleted the task-local-macro-hack branch May 23, 2024 18:39
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