-
Notifications
You must be signed in to change notification settings - Fork 56
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
NSError**
params have unexpected generic private type
#1864
Comments
ffigen translates ObjC's A) One option would be to just take a B) Another option would be to implement option A, but with another layer of indirection to solve the mutability issue. Add another pointer type, eg C) Maybe the best way to translate these methods would be to change the signature to One complication is that there are other uses of I'll handle the privacy half of this issue in milestone 17, and if we can figure out how to translate |
B seems like the most intuitive option to me. C feels out of place to me at the FFI layer; it seems like the kind of thing that I would expect from an abstraction layer above FFI generation—especially because it is enforcing an opinionated conversion in a way that almost nothing else at this layer does. (E.g., is a Go-style record return the "right" Dart expression of this? Maybe it should be throwing an exception instead, to better align with Swift.) |
Generating
NSBundle
gives me the following methods:For clients this translates to
Pointer<Pointer<_ObjCObject>>
. This has all of the problems described in #1861 (and #1862 and #1863); I would expect this to be a public generic NSObject type rather than a private one if it's generic.However, it also seems to be unexpectedly generic. I thought that was because I didn't include
NSError
in my ffi config, so I added it to avoid this problem... but it didn't; the type was still the same. I would expect the inner type to beNSError
.The text was updated successfully, but these errors were encountered: