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 a0d24fbCopy full SHA for a0d24fb
lib/IRGen/GenReflection.cpp
@@ -931,6 +931,15 @@ 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.getKind() == Field::Kind::Var &&
939
+ field.getVarDecl()->getClangDecl() &&
940
+ field.getVarDecl()->getFormalAccess() == AccessLevel::Private)
941
+ return;
942
+
943
addField(field);
944
});
945
}
0 commit comments