Skip to content

[Macros] Fix source location for declaration syntax of attached macros #73716

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

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented May 17, 2024

Use the correct source file.
Previously, the location of declaration macros were sent to executable plugins as if the node were in the source file of the attribute. This was problematic when the attribute is synsthesized by a macro. When source location were used in the plugin, for example, as a diagnostic location, it ended up with an unknown location.

Use the correct source file.
Previously, the location of declaration macros were sent to executable
plugins as if the were in the source file of the attribute. This was
problematic when the attribute is synsthesized by a macro. When source
location were used in the plugin, for example, as a diagnostic location,
it ended up with an unknown location.
@@ -2,6 +2,7 @@

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend %s -swift-version 5 -module-name main -disable-availability-checking -typecheck -verify -plugin-path %swift-plugin-dir
// RUN: %target-swift-frontend %s -swift-version 5 -module-name main -disable-availability-checking -typecheck -verify -external-plugin-path %swift-plugin-dir#%swift-plugin-server
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using -external-plugin-path make it use expandAttachedMacroIPC() code path.

@rintaro
Copy link
Member Author

rintaro commented May 17, 2024

@swift-ci Please smoke test

@rintaro rintaro merged commit a184ca0 into swiftlang:main May 17, 2024
3 checks passed
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.

2 participants