Skip to content

[interop][SwiftToCxx] add additional type representation emission che… #65397

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 1 commit into from
Apr 28, 2023

Conversation

hyp
Copy link
Contributor

@hyp hyp commented Apr 24, 2023

…ck for associated enum element types

This ensures that we do not try to emit enums whose associated values come from dependent modules that don't have a C++ representation

Also remove outdated FIXME for enum availability.

@hyp hyp added the c++ interop Feature: Interoperability with C++ label Apr 24, 2023
@hyp hyp requested a review from ravikandhadai April 24, 2023 19:28
@hyp hyp requested review from zoecarver and egorzhdan as code owners April 24, 2023 19:28
@hyp
Copy link
Contributor Author

hyp commented Apr 24, 2023

@swift-ci please test

@hyp
Copy link
Contributor Author

hyp commented Apr 24, 2023

@swift-ci please test source compatibility

…ck for associated enum element types

This ensures that we do not try to emit enums whose associated values come from dependent modules that don't have a C++ representation
@hyp hyp force-pushed the eng/enum-final-boss branch from 0206f2b to 7efae9a Compare April 24, 2023 19:31
@hyp
Copy link
Contributor Author

hyp commented Apr 24, 2023

@swift-ci please test

@hyp
Copy link
Contributor Author

hyp commented Apr 24, 2023

@swift-ci please test source compatibility

@hyp
Copy link
Contributor Author

hyp commented Apr 25, 2023

@swift-ci please test windows platform

// we also need to perform additional check on whether the type can be
// emitted here as well, to ensure that we don't emit types from dependent
// modules that do not have a C++ representation.
for (const auto *enumCase : enumDecl->getAllCases()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just going by the comment, is there any code duplication between the checks done in getDeclRepresentation and the checks here. Is there an opportunity to factor this out to a common helper function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes as a follow-up

@hyp hyp merged commit 4365bc0 into swiftlang:main Apr 28, 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++
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants