@@ -141,6 +141,9 @@ class CommonTypeInfo : public CommonEntityInfo {
141141 // / The NS error domain for this type.
142142 std::optional<std::string> NSErrorDomain;
143143
144+ // / The Swift protocol that this type should be automatically conformed to.
145+ std::optional<std::string> SwiftConformance;
146+
144147public:
145148 CommonTypeInfo () {}
146149
@@ -165,6 +168,14 @@ class CommonTypeInfo : public CommonEntityInfo {
165168 : std::nullopt ;
166169 }
167170
171+ std::optional<std::string> getSwiftConformance () const {
172+ return SwiftConformance;
173+ }
174+
175+ void setSwiftConformance (std::optional<std::string> conformance) {
176+ SwiftConformance = conformance;
177+ }
178+
168179 friend bool operator ==(const CommonTypeInfo &, const CommonTypeInfo &);
169180
170181 CommonTypeInfo &operator |=(const CommonTypeInfo &RHS) {
@@ -175,6 +186,8 @@ class CommonTypeInfo : public CommonEntityInfo {
175186 setSwiftBridge (RHS.getSwiftBridge ());
176187 if (!NSErrorDomain)
177188 setNSErrorDomain (RHS.getNSErrorDomain ());
189+ if (SwiftConformance)
190+ setSwiftConformance (RHS.getSwiftConformance ());
178191
179192 return *this ;
180193 }
@@ -185,7 +198,8 @@ class CommonTypeInfo : public CommonEntityInfo {
185198inline bool operator ==(const CommonTypeInfo &LHS, const CommonTypeInfo &RHS) {
186199 return static_cast <const CommonEntityInfo &>(LHS) == RHS &&
187200 LHS.SwiftBridge == RHS.SwiftBridge &&
188- LHS.NSErrorDomain == RHS.NSErrorDomain ;
201+ LHS.NSErrorDomain == RHS.NSErrorDomain &&
202+ LHS.SwiftConformance == RHS.SwiftConformance ;
189203}
190204
191205inline bool operator !=(const CommonTypeInfo &LHS, const CommonTypeInfo &RHS) {
@@ -824,9 +838,6 @@ class TagInfo : public CommonTypeInfo {
824838 std::optional<std::string> SwiftRetainOp;
825839 std::optional<std::string> SwiftReleaseOp;
826840
827- // / The Swift protocol that this type should be automatically conformed to.
828- std::optional<std::string> SwiftConformance;
829-
830841 std::optional<EnumExtensibilityKind> EnumExtensibility;
831842
832843 TagInfo ()
@@ -873,9 +884,6 @@ class TagInfo : public CommonTypeInfo {
873884 if (!SwiftReleaseOp)
874885 SwiftReleaseOp = RHS.SwiftReleaseOp ;
875886
876- if (!SwiftConformance)
877- SwiftConformance = RHS.SwiftConformance ;
878-
879887 if (!HasFlagEnum)
880888 setFlagEnum (RHS.isFlagEnum ());
881889
@@ -901,7 +909,6 @@ inline bool operator==(const TagInfo &LHS, const TagInfo &RHS) {
901909 LHS.SwiftImportAs == RHS.SwiftImportAs &&
902910 LHS.SwiftRetainOp == RHS.SwiftRetainOp &&
903911 LHS.SwiftReleaseOp == RHS.SwiftReleaseOp &&
904- LHS.SwiftConformance == RHS.SwiftConformance &&
905912 LHS.isFlagEnum () == RHS.isFlagEnum () &&
906913 LHS.isSwiftCopyable () == RHS.isSwiftCopyable () &&
907914 LHS.isSwiftEscapable () == RHS.isSwiftEscapable () &&
0 commit comments