Skip to content

Metadata-generator creates enums with incorrect values #258

Open
@CatchABus

Description

@CatchABus

There is the case of metadata-generator creating enums with wrong values if the original value is unsigned.
This became apparent with UIRectCornerAllCorners case where value is an unsigned long in obj-c.

UIRectCornerAllCorners = ~0UL

See: https://developer.apple.com/documentation/uikit/uirectcorner/uirectcornerallcorners?language=objc

Unfortunately, generator converts the value into a signed value resulting in -1 and when it's used as a function parameter, it brings unexpected results.

In JavaScript, the proper value would probably be 0xffffffff or 4294967295 to match the unsigned value.

I found this part of generator that looks suspicious: https://github.com/NativeScript/ios/blob/main/metadata-generator/src/Meta/MetaFactory.cpp#L321

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions