-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Reland "[cxx-interop] Allow import-as-member for types in namespaces" #83261
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
Reland "[cxx-interop] Allow import-as-member for types in namespaces" #83261
Conversation
…espaces"" This reverts commit dd809c6.
|
@swift-ci please test |
|
@swift-ci please test |
|
@swift-ci please test |
6076c38 to
4d6d9a7
Compare
|
@swift-ci please test |
I'm a little bit confused by this. Was this logic on the Swift side or the Clang side? And what was changed between the original patches and these re-landed patches? The only difference I see with respect to the original patch is this, on the Swift side: if (!parentContext)
return nullptr;And the Clang side re-land looks identical to before. But I thought the problem would stem from the Clang side, since the issue required us to revert the Clang side as well. Or did I miss a Clang-side difference? |
…w.rawValue` AppKit renames some of its C constants via API Notes, e.g. `NSUpArrowFunctionKey` is renamed into `NSEvent.SpecialKey.upArrow.rawValue`. In this example, `NSEvent` is an existing type, but `SpecialKey` is not, so the Swift compiler synthesizes an empty type named `SpecialKey`. The logic that was added to support import-as-member for namespaces did not account for this: it assumed that if a nested type wasn't found, then the name must be invalid. rdar://154783494
4d6d9a7 to
e4af21f
Compare
|
@swift-ci please test |
|
@j-hui good question, the split between a Clang-side change and a Swift-side change is indeed confusing here. The problematic part of this change was actually on the Swift side: the incorrect diagnostic ( The Clang-side change was correct, so I'm bringing it back as-is. The Swift-side change rejected attributes that were previously accepted and are present in the SDK, so I made it more permissive this time. |
This brings back e95f6a3 after it got reverted in dd809c6.
Please see the original PR for motivation: #82496.
This fixes the following issue with the original PR:
AppKit renames some of its C constants via API Notes, e.g.
NSUpArrowFunctionKeyis renamed intoNSEvent.SpecialKey.upArrow.rawValue.In this example,
NSEventis an existing type, butSpecialKeyis not, so the Swift compiler synthesizes an empty type namedSpecialKey.The logic that was added to support import-as-member for namespaces did not account for this: it assumed that if a nested type wasn't found, then the name must be invalid.
rdar://154783494