[🍒][cxx-interop] Correctly import fields with type NS_OPTIONS
.
#66563
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Explanation: NS_OPTIONS has a different definition in ObjC/C and C++. The C++ definition makes it hard for us to match up the enum with the typedef (type). We have had to add some ugly special cases that lookup the associated enum using an attribute:
findAnonymousEnumForTypedef
. We've updated most places that import types to check for this special case, but every now and again we find another edge case. Hopefully this is the last one. This patch adds this special case/lookup when we are importing the type of fields. This bug has been hitting a lot of people, see #65885 and rdar://109830715Scope: C++ interoperability
Risk: Low, changes a narrow class of API imports; uses same pattern as elsewhere to find NS_OPTIONS.
Testing: Swift unit tests.
PR: #66452