Skip to content

[Interop][SwiftToCxx] add support for resilient enum #60451

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
Aug 11, 2022

Conversation

WANGJIEKE
Copy link
Contributor

Changes:

  • Update IRABIDetailsProvider::getEnumTagMapping so that it will also return the global variable name for the enum tag
  • Update operator cases in the printed header: supporting resilient enum
  • Update bool isXyz() in the printed header: these functions will compare with the tag constants (non-resilient) or tag global variables (resilient) directly
  • Add bool inResilientUnknownCase() in the printed header for resilient enum, allowing checking if the enum is in an unknown case
  • Add tag global variables for resilient enum in the _impl namespace of printed header
  • Update tests accordingly

@hyp Could you please review this pull request? Thanks.

@hyp
Copy link
Contributor

hyp commented Aug 8, 2022

please rebase :)

@hyp hyp added the c++ interop Feature: Interoperability with C++ label Aug 8, 2022
@WANGJIEKE WANGJIEKE force-pushed the cxx-interop-resilient-enum branch from fcf25a4 to ff28b56 Compare August 8, 2022 21:51
@hyp
Copy link
Contributor

hyp commented Aug 8, 2022

@swift-ci please test

@hyp
Copy link
Contributor

hyp commented Aug 8, 2022

@swift-ci please test source compatibility

2 similar comments
@hyp
Copy link
Contributor

hyp commented Aug 9, 2022

@swift-ci please test source compatibility

@hyp
Copy link
Contributor

hyp commented Aug 10, 2022

@swift-ci please test source compatibility

@hyp hyp self-requested a review August 10, 2022 15:39
Copy link
Contributor

@hyp hyp left a comment

Choose a reason for hiding this comment

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

We have discussed a redesign for handling resilient enum cases (and non-resilient as well). This PR is fine as a precursor to the PR that implements the redesign for the enum cases.

@hyp hyp merged commit 9151db5 into swiftlang:main Aug 11, 2022
@WANGJIEKE WANGJIEKE deleted the cxx-interop-resilient-enum branch August 11, 2022 14:54
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