diff --git a/shell/platform/darwin/macos/framework/Source/FlutterChannelKeyResponder.mm b/shell/platform/darwin/macos/framework/Source/FlutterChannelKeyResponder.mm index 98abd505d4d9b..d3f1551533304 100644 --- a/shell/platform/darwin/macos/framework/Source/FlutterChannelKeyResponder.mm +++ b/shell/platform/darwin/macos/framework/Source/FlutterChannelKeyResponder.mm @@ -131,10 +131,13 @@ - (void)handleEvent:(NSEvent*)event callback:(FlutterAsyncKeyCallback)callback { return; } break; - default: { - NSAssert(false, @"Unexpected key event type (got %lu).", event.type); - callback(false); - } + default: + [[unlikely]] { + NSAssert(false, @"Unexpected key event type (got %lu).", event.type); + callback(false); + // This should not happen. Return to suppress clang-tidy warning on `type` being nil. + return; + } } _previouslyPressedFlags = modifierFlags; NSMutableDictionary* keyMessage = [@{