mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[cxx-interop] Support foreing reference types in generic context
Print the type traits in reverse interop to enable the use of foreign reference type in generics like Swift arrays. Also make sure optional foreign reference types can be passed around as raw pointers. rdar://108139769
This commit is contained in:
@@ -579,8 +579,9 @@ public:
|
||||
forwardDeclareCxxValueTypeIfNeeded(NTD);
|
||||
else if (isa<StructDecl>(TD) && NTD->hasClangNode())
|
||||
emitReferencedClangTypeMetadata(NTD);
|
||||
else if (isa<ClassDecl>(TD) && TD->isObjC())
|
||||
emitReferencedClangTypeMetadata(NTD);
|
||||
else if (const auto *cd = dyn_cast<ClassDecl>(TD))
|
||||
if (cd->isObjC() || cd->isForeignReferenceType())
|
||||
emitReferencedClangTypeMetadata(NTD);
|
||||
} else if (auto TAD = dyn_cast<TypeAliasDecl>(TD)) {
|
||||
if (TAD->hasClangNode())
|
||||
emitReferencedClangTypeMetadata(TAD);
|
||||
|
||||
Reference in New Issue
Block a user