Skip to content

[interop][SwiftToCxx] do not expose unsupported enums yet #65351

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

Conversation

hyp
Copy link
Contributor

@hyp hyp commented Apr 21, 2023

This includes indirect enums, enums with multiple associated values, or enums whose associated value is a type we don't yet support

(cherry picked from commit 71ef7e8)

Explanation: C++ header generation only supports a subset of Swift enum types. We do not support enums with associated values whose type is not supported, so we should not emit them in the generated header. This fixes a crash we observe when building one package with interop.
Scope: Swift's and C++ interoperability, Generated header printer.
Risk: Low. This only affects users who turn on availability, and it prevents emission of C++ APIs for enums which didn't work in C++ anyway.
Testing: Swift unit tests.
Reviewer: @zoecarver

This includes indirect enums, enums with multiple associated values, or enums whose associated value is a type we don't yet support

(cherry picked from commit 71ef7e8)
@hyp hyp added the c++ interop Feature: Interoperability with C++ label Apr 21, 2023
@hyp hyp requested a review from a team as a code owner April 21, 2023 16:40
@hyp
Copy link
Contributor Author

hyp commented Apr 21, 2023

@swift-ci please test

@hyp
Copy link
Contributor Author

hyp commented Apr 21, 2023

@swift-ci please test source compatibility

@hyp hyp merged commit 0dc470c into swiftlang:release/5.9 Apr 24, 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