Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata-generator creates enums with incorrect values #258

Open
CatchABus opened this issue Jul 27, 2024 · 0 comments
Open

Metadata-generator creates enums with incorrect values #258

CatchABus opened this issue Jul 27, 2024 · 0 comments

Comments

@CatchABus
Copy link

CatchABus commented Jul 27, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant