Skip to content

KeyCodeMap.g.mm "using 'initWithDictionary:' with a literal is redundant" #146480

@jmagman

Description

@jmagman

I tried to compile KeyCodeMap.g.mm with ARC instead of MRC as part of #137801 and it failed.

../../flutter/shell/platform/darwin/ios/framework/Source/KeyCodeMap.g.mm:332:57: error: using 'initWithDictionary:' with a literal is redundant [-Werror,-Wobjc-redundant-literal-use]
  332 | NSDictionary<NSString*, NSNumber*>* specialKeyMapping = [[NSDictionary alloc] initWithDictionary:@{

https://github.com/flutter/flutter/blob/6a5be75eb30f3bc5757431fc30dab148191e0124/dev/tools/gen_keycodes/data/ios_key_code_map_mm.tmpl#L52C1-L52C100

-NSDictionary<NSString*, NSNumber*>* specialKeyMapping = [[NSDictionary alloc] initWithDictionary:@{
+NSDictionary<NSString*, NSNumber*>* specialKeyMapping = @{
@@@SPECIAL_KEY_MAPPING@@@
-}];
+};

See also #106909

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listengineflutter/engine related. See also e: labels.platform-iosiOS applications specifically

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions