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