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

Handle ObjC static functions that take interfaces #308

Closed
liamappelbe opened this issue Apr 8, 2022 · 1 comment
Closed

Handle ObjC static functions that take interfaces #308

liamappelbe opened this issue Apr 8, 2022 · 1 comment
Assignees
Labels
lang-objective_c Related to Objective C support package:ffigen stable objc blocker Need for ObjC to be considered stable

Comments

@liamappelbe
Copy link
Contributor

If you write an ordinary C style function that takes an ObjC interface:

NSString* strConcat(NSString* a, NSString* b) {

The generated binding for this is:

ffi.Pointer<ObjCObject> strConcat(ffi.Pointer<ObjCObject> a, ffi.Pointer<ObjCObject> b) {

We should use the wrapper object instead, and convert to ffi.Pointer<ObjCObject> automatically:

NSString strConcat(NSString a, NSString b) {

We do this already for interface methods, so we might just need to move that special casing to the function code generator.

@liamappelbe liamappelbe added the lang-objective_c Related to Objective C support label Apr 8, 2022
@liamappelbe liamappelbe self-assigned this Apr 8, 2022
@liamappelbe liamappelbe added the stable objc blocker Need for ObjC to be considered stable label Aug 24, 2022
@liamappelbe liamappelbe transferred this issue from dart-archive/ffigen Nov 15, 2023
HosseinYousefi added a commit that referenced this issue Nov 16, 2023
… in config (#308)

* Parse Kotlin's metadata in API Summarizer
* Remove `suspend_fun_to_async` from config now that `isSuspend` reliably detect `suspend fun`s.
HosseinYousefi added a commit that referenced this issue Nov 16, 2023
… in config (#308)

* Parse Kotlin's metadata in API Summarizer
* Remove `suspend_fun_to_async` from config now that `isSuspend` reliably detect `suspend fun`s.
@liamappelbe
Copy link
Contributor Author

This was fixed by dart-archive/ffigen#633

parlough pushed a commit to parlough/native that referenced this issue Apr 8, 2024
* Add an integration test for objective C

* Switch CI to use test/setup.dart

* Trying to fix CI

* Fix handling of void functions and property setters and getters
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 stable objc blocker Need for ObjC to be considered stable
Projects
None yet
Development

No branches or pull requests

1 participant