Skip to content

[pigeon] Enum objc generator has invalid int cast #84167

@gaaclarke

Description

@gaaclarke

We are doing an invalid cast to an integer from a pointer type. I think it was intended to be result.state = [dict[@"state"] integerValue];

I'm not sure why this passed on CI.

steps to reproduce:
./run_tests.sh -t objc_compilation_tests

error:

test_pigeon_ios(./pigeons/message.dart)
flutter_pigeon.UD0pma/pigeon.m:49:18: error: cast to smaller integer type 'int' from 'id _Nullable' [-Werror,-Wpointer-to-int-cast]
  result.state = (int)dict[@"state"];
                 ^~~~~~~~~~~~~~~~~~~
1 error generated.

cc @GaryQian

Metadata

Metadata

Assignees

No one assigned

    Labels

    p: pigeonrelated to pigeon messaging codegen tool

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions