From c073797f98fc99a256681d93afea66e404a07e91 Mon Sep 17 00:00:00 2001 From: Richard Howell Date: Wed, 14 May 2025 09:26:22 -0700 Subject: [PATCH] fix Swift compiler assert Summary: Asserts toolchains are crashing on compiling this header: ``` (struct_type decl="ObjectiveC.(file).ObjCBool") (type_alias_type decl="ExecuTorch.(file).BoolValue@buck-out/v2/gen/fbsource/b60f3548330a4950/xplat/executorch/extension/apple/__ExecuTorch__/ExecuTorch_symlink_tree/ExecuTorch/ExecuTorchValue.h:37:14" (underlying=struct_type decl="Swift.(file).Bool")) swift-frontend: /data/sandcastle/boxes/trunk-grepo-llvm-c2-grepo/external/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. 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