-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[Swiftify] Add support for free functions imported as instance methods #84507
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
base: main
Are you sure you want to change the base?
Conversation
@swift-ci please smoke test |
This adds support for attaching safe interop wrappers to functions explicitly imported as instance methods using swift_name. rdar://156288883
628fc8a
to
c1bf742
Compare
@swift-ci please smoke test |
1 similar comment
@swift-ci please smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, left some small questions/nits inline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
While we handled prepending & to MutableSpan parameters, regular parameters that were unchanged during the transformation were not checked for inout-ness.
@swift-ci please smoke test |
@swift-ci please smoke test |
Since the compiler invokation performing the macro expansion dump redirects its stderr output, any errors are not displayed by default. This is extra problematic for test failures in CI. By performing the compiler invokation with -verify first, errors are shown.
@swift-ci please smoke test |
@swift-ci please smoke test |
@swift-ci please smoke test |
let args: [ExprSyntax] = base.signature.parameterClause.parameters.enumerated() | ||
.map { (i: Int, param: FunctionParameterSyntax) in | ||
return pointerArgs[i] ?? ExprSyntax("\(param.name)") | ||
if let overrideArg = pointerArgs[i] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this is a fix we want to backport to 6.2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's probably a good idea
@swift-ci please smoke test |
This adds support for attaching safe interop wrappers to functions explicitly imported as instance methods using swift_name.
rdar://156288883