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 type defined in UDL can't be referenced in record defined by a procmacro #1854

Closed
mhammond opened this issue Nov 18, 2023 · 0 comments

Comments

@mhammond
Copy link
Member

In our ext-types fixture we import a type named UniffiOneInterface which is defined via UDL in another crate

While that crate works, it fails if that same crate tries to refer to that type in a dictionary defined by a procmacro, eg:

#[derive(Default, uniffi::Record)]
pub struct ObjectsType {
    pub maybe_interface: Option<Arc<UniffiOneInterface>>,
}

fails with:

thread 'uniffi_foreign_language_testcase_test_imported_types_swift' panicked at 'assertion failed: `(left == right)`
  left: `External { module_path: "uniffi_one", name: "UniffiOneInterface", namespace: "uniffi_one_ns", kind: Interface, tagged: false }`,
 right: `External { module_path: "uniffi_one", name: "UniffiOneInterface", namespace: "uniffi_one_ns", kind: Interface, tagged: true }`', uniffi_bindgen/src/interface/universe.rs:49:17

The problem is that things get confused about whether the external type is tagged or not. This is another example of where having some types be tagged and others not causes problems.

mhammond added a commit to mhammond/uniffi-rs that referenced this issue Nov 20, 2023
Some tweaks to Kotlin were necessary and apart from discovering mozilla#1854
things tended to work fine.
mhammond added a commit to mhammond/uniffi-rs that referenced this issue Nov 21, 2024
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