Skip to content

[Macros] A few bug fixes for extension macros. #67186

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 3 commits into from
Jul 8, 2023

Conversation

hborla
Copy link
Member

@hborla hborla commented Jul 8, 2023

This fixes 3 small issues with extension macros:

  1. When resolving extension macro protocol conformances, handle the case where a protocol has a null type repr because it was deserialized. This fixes an issue where imported extension macros with a conformances: list appeared to not add any conformances, and expansion was always passed an empty protocols array.
  2. In SILSymbolVisitor, skip local conformance entries from pre-expanded macros. This fixes an assertion failure in TBDGen due to duplicate conformances.
  3. Fix a silly copy-paste error in ASTGen that caused a bogus conformance list to be passed to extension macro expansion on the plugin server path.

These changes allow @Observable to adopt extension macros in #66993

@hborla hborla requested review from slavapestov and xedin as code owners July 8, 2023 00:22
@hborla hborla requested review from zoecarver and CodaFi as code owners July 8, 2023 02:19
@hborla hborla changed the title [Macros] Handle the case where an extension macro conformance has a null type repr because it was deserialized. [Macros] A few bug fixes for extension macros. Jul 8, 2023
@hborla
Copy link
Member Author

hborla commented Jul 8, 2023

@swift-ci please smoke test

@hborla hborla merged commit 3512196 into swiftlang:main Jul 8, 2023
@hborla hborla deleted the extension-macro-fixes branch July 8, 2023 05:19
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