File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -3702,8 +3702,16 @@ EffectiveClangContext ClangImporter::Implementation::getEffectiveClangContext(
3702
3702
(nominal->getAttrs ().hasAttribute <ObjCAttr>() ||
3703
3703
(!nominal->getParentSourceFile () && nominal->isObjC ()))) {
3704
3704
// Map the name. If we can't represent the Swift name in Clang.
3705
- // FIXME: We should be using the Objective-C name here!
3706
- auto clangName = exportName (nominal->getName ());
3705
+ Identifier name = nominal->getName ();
3706
+ if (auto objcAttr = nominal->getAttrs ().getAttribute <ObjCAttr>()) {
3707
+ if (auto objcName = objcAttr->getName ()) {
3708
+ if (objcName->getNumArgs () == 0 ) {
3709
+ // This is an error if not 0, but it should be caught later.
3710
+ name = objcName->getSimpleName ();
3711
+ }
3712
+ }
3713
+ }
3714
+ auto clangName = exportName (name);
3707
3715
if (!clangName)
3708
3716
return EffectiveClangContext ();
3709
3717
You can’t perform that action at this time.
0 commit comments