We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 660a2ea commit 6542187Copy full SHA for 6542187
lib/IRGen/GenReflection.cpp
@@ -931,6 +931,14 @@ class FieldTypeMetadataBuilder : public ReflectionMetadataBuilder {
931
932
B.addInt32(getNumFields(NTD));
933
forEachField(IGM, NTD, [&](Field field) {
934
+ // Skip private C++ fields that were imported as private Swift fields.
935
+ // The type of a private field might not have all the type witness
936
+ // operations that Swift requires, for instance,
937
+ // `std::unique_ptr<IncompleteType>` would not have a destructor.
938
+ if (field.getVarDecl()->getClangDecl() &&
939
+ field.getVarDecl()->getFormalAccess() == AccessLevel::Private)
940
+ return;
941
+
942
addField(field);
943
});
944
}
0 commit comments