Skip to content

NSDecimal error #248

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

Closed
liamappelbe opened this issue Jun 29, 2022 · 2 comments · Fixed by dart-archive/ffigen#415
Closed

NSDecimal error #248

liamappelbe opened this issue Jun 29, 2022 · 2 comments · Fixed by dart-archive/ffigen#415
Assignees
Labels
lang-objective_c Related to Objective C support package:ffigen

Comments

@liamappelbe
Copy link
Contributor

NSDecimal is a bitfield struct, which is not supported, so it is treated as an incomplete struct. However, this check happens after methods/functions are parsed, so the usual check that ignores functions that take/return incomplete structs doesn't work.

The best fix would probably just be to move the bitfield check earlier in the parsing.

@liamappelbe liamappelbe added the lang-objective_c Related to Objective C support label Jun 29, 2022
@liamappelbe liamappelbe self-assigned this Jun 29, 2022
@liamappelbe
Copy link
Contributor Author

However, this check happens after methods/functions are parsed

This is wrong. The issue is that NSDecimal is being used as a property. I didn't implement the incomplete struct check for properties, because you can't use an incomplete struct as a property (since the property becomes field on the class). But you can use bit fields as properties. So I just need to implement this check for properties.

@dcharkes
Copy link
Collaborator

dcharkes commented Jul 7, 2022

For bitfields by value we might need Dart VM support, because currently we need to emit chars/uint16/uint32/uint64 structs to ensure alignment is correct.

I've filed

to track that.

@liamappelbe liamappelbe transferred this issue from dart-archive/ffigen Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang-objective_c Related to Objective C support package:ffigen
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants