Skip to content

Conversation

@hnrklssn
Copy link
Member

The existing _SwiftifyImport macro is a peer macro, limiting it to only emitting function wrappers in the same scope as the original function. Protocols cannot contain function implementations, so these need to be placed in a separate protocol extension instead. _SwiftifyImportProtocol is an extension macro rather than a peer macro, to enable this functionality.

Rather than operating on a single function, like _SwiftifyImport, _SwiftifyImportProtocol takes information about multiple methods and creates a single protocol extension with all wrappers in a one-shot operation.

Towards completion of rdar://144335990

Extracted from #79510

The existing _SwiftifyImport macro is a peer macro, limiting it to only
emitting function wrappers in the same scope as the original function.
Protocols cannot contain function implementations, so these need to be
placed in a separate protocol extension instead. _SwiftifyImportProtocol
is an extension macro rather than a peer macro, to enable this
functionality.

Rather than operating on a single function, like _SwiftifyImport,
_SwiftifyImportProtocol takes information about multiple methods and
creates a single protocol extension with all wrappers in a one-shot
operation.

rdar://144335990
@hnrklssn hnrklssn requested review from a team and Xazax-hun as code owners October 22, 2025 04:24
@hnrklssn
Copy link
Member Author

@swift-ci please smoke test

@hnrklssn
Copy link
Member Author

@swift-ci please smoke test macos platform

1 similar comment
@hnrklssn
Copy link
Member Author

@swift-ci please smoke test macos platform

@hnrklssn
Copy link
Member Author

@swift-ci please smoke test

@hnrklssn hnrklssn merged commit 6f1936f into swiftlang:main Oct 23, 2025
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