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

External types are not supported #40

Open
arg0d opened this issue Oct 19, 2023 · 0 comments
Open

External types are not supported #40

arg0d opened this issue Oct 19, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@arg0d
Copy link
Collaborator

arg0d commented Oct 19, 2023

External types are not supported right now, because C# has limitations regarding custom types. Custom types are implemented as C# type aliases with using directive using A = B;. The using directive is file local, and the type alias is not visible outside the file its defined in. So, trying to use external types with custom types results in broken code. It might be possible to external types referencing custom types, but we haven't had the time to explore this yet. Using library mode in uniffi 0.24, it might be possible to dereference external types across UDL boundary, and emit the underlying type directly without needing to reference type alias from another C# file.

Supporting external types without referencing custom types should be possible, but some kind of warning should be implemented to warn the users of this issue. Also, upstream tests can't be used, because the tests use external types to reference custom types. Supporting external types is not a priority for us right now, but contributions are welcome.

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

No branches or pull requests

1 participant