@@ -3168,6 +3168,15 @@ bool TypeSystemSwiftTypeRef::IsTypedefType(opaque_compiler_type_t type) {
3168
3168
NodePointer node = GetDemangledType (dem, AsMangledName (type));
3169
3169
if (node && node->getKind () == Node::Kind::BuiltinTypeName)
3170
3170
return impl ();
3171
+
3172
+ // This is a discrepancy with `SwiftASTContext`. `impl` correctly
3173
+ // returns true, but `VALIDATE_AND_RETURN` will assert. This hardcoded
3174
+ // handling of `__C.NSNotificationName` and `__C.NSDecimal` can be removed
3175
+ // when the `VALIDATE_AND_RETURN` is removed.
3176
+ auto mangled_name = GetMangledTypeName (type);
3177
+ if (mangled_name == " $sSo18NSNotificationNameaD" ||
3178
+ mangled_name == " $sSo9NSDecimalaD" )
3179
+ return impl ();
3171
3180
#endif
3172
3181
VALIDATE_AND_RETURN (impl, IsTypedefType, type, (ReconstructType (type)),
3173
3182
(ReconstructType (type)));
@@ -3200,6 +3209,15 @@ TypeSystemSwiftTypeRef::GetTypedefedType(opaque_compiler_type_t type) {
3200
3209
NodePointer node = GetDemangledType (dem, AsMangledName (type));
3201
3210
if (node && node->getKind () == Node::Kind::BuiltinTypeName)
3202
3211
return impl ();
3212
+
3213
+ // This is a discrepancy with `SwiftASTContext`. `impl` correctly
3214
+ // returns true, but `VALIDATE_AND_RETURN` will assert. This hardcoded
3215
+ // handling of `__C.NSNotificationName` and `__C.NSDecimal` can be removed
3216
+ // when the `VALIDATE_AND_RETURN` is removed.
3217
+ auto mangled_name = GetMangledTypeName (type);
3218
+ if (mangled_name == " $sSo18NSNotificationNameaD" ||
3219
+ mangled_name == " $sSo9NSDecimalaD" )
3220
+ return impl ();
3203
3221
#endif
3204
3222
VALIDATE_AND_RETURN (impl, GetTypedefedType, type, (ReconstructType (type)),
3205
3223
(ReconstructType (type)));
0 commit comments