From 2a1563ebc992851686f2f1a055e6094ffc960e1c Mon Sep 17 00:00:00 2001 From: Richard Howell Date: Wed, 14 May 2025 10:33:28 -0700 Subject: [PATCH] fix Swift compiler assert (#10874) Summary: Asserts toolchains are crashing on compiling this header: ``` (struct_type decl="ObjectiveC.(file).ObjCBool") (type_alias_type decl="ExecuTorch.(file).BoolValue@/ExecuTorch/ExecuTorchValue.h:37:14" (underlying=struct_type decl="Swift.(file).Bool")) swift-frontend: swift/lib/ClangImporter/ImportType.cpp:928: ImportResult (anonymous namespace)::SwiftTypeConverter::VisitTypedefType(const clang::TypedefType *): Assertion `underlyingResult.AbstractType->isEqual(mappedType) && "typedef without special typedef kind was mapped " "differently from its underlying type?"' failed. ``` Remove `NS_SWIFT_BRIDGED_TYPEDEF` to mitigate. Reviewed By: shoumikhin, AdamCmiel Differential Revision: D74737507 --- extension/apple/ExecuTorch/Exported/ExecuTorchValue.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/extension/apple/ExecuTorch/Exported/ExecuTorchValue.h b/extension/apple/ExecuTorch/Exported/ExecuTorchValue.h index 1554132e929..f95fa48210a 100644 --- a/extension/apple/ExecuTorch/Exported/ExecuTorchValue.h +++ b/extension/apple/ExecuTorch/Exported/ExecuTorchValue.h @@ -34,8 +34,7 @@ typedef NSNumber *ExecuTorchScalarValue NS_SWIFT_BRIDGED_TYPEDEF NS_SWIFT_NAME(ScalarValue); typedef NSString *ExecuTorchStringValue NS_SWIFT_BRIDGED_TYPEDEF NS_SWIFT_NAME(StringValue); -typedef BOOL ExecuTorchBooleanValue - NS_SWIFT_BRIDGED_TYPEDEF NS_SWIFT_NAME(BoolValue); +typedef BOOL ExecuTorchBooleanValue NS_SWIFT_NAME(BoolValue); typedef NSInteger ExecuTorchIntegerValue NS_SWIFT_BRIDGED_TYPEDEF NS_SWIFT_NAME(IntegerValue); typedef double ExecuTorchDoubleValue