Skip to content

[5.9][interop] Ensure an FRT or a pointer to struct/class gets a Swift typ… #65452

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

Conversation

hyp
Copy link
Contributor

@hyp hyp commented Apr 26, 2023

…e name for a C++ template parameter

In the follow-up, I should also expand this to cover pointers to builtin types too, but for now lets go with a miminal fix here

(cherry picked from commit 0fff769)

Explanation: Swift type name importer imports C++ template parameters as _ in cases where it can't provide a good Swift name. This logic did not handle the case where the template parameter was a pointer type, either a pointer to a foreign reference type, or a regular C++ record that's brought in as a value type. This patch expands this logic and ensures that these types are printed clearly, so that the user can see them when code-completing APIs or looking at the module interface print out of an API that uses such a type.
Scope: Swift's and C++ interoperability, Clang importer.
Risk: Low. This change only touches on C++ template parameters, which are only reached when C++ interoperability is enabled.
Testing: Swift unit tests.
Reviewer: @zoecarver

…e name for a C++ template parameter

In the follow-up, I should also expand this to cover pointers to builtin types too, but for now lets go with a miminal fix here

(cherry picked from commit 0fff769)
@hyp hyp added the c++ interop Feature: Interoperability with C++ label Apr 26, 2023
@hyp hyp requested a review from a team as a code owner April 26, 2023 22:15
@hyp
Copy link
Contributor Author

hyp commented Apr 26, 2023

@swift-ci please test

@hyp
Copy link
Contributor Author

hyp commented Apr 26, 2023

@swift-ci please test source compatibility

@hyp hyp changed the title [interop] Ensure an FRT or a pointer to struct/class gets a Swift typ… [5.9][interop] Ensure an FRT or a pointer to struct/class gets a Swift typ… Apr 26, 2023
@hyp hyp merged commit fb3986f into swiftlang:release/5.9 Apr 27, 2023
@AnthonyLatsis AnthonyLatsis added the 🍒 release cherry pick Flag: Release branch cherry picks label May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ interop Feature: Interoperability with C++ 🍒 release cherry pick Flag: Release branch cherry picks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants