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

Using an uniffi::Error inside a struct generates code that doesn't compile #62

Open
BillCarsonFr opened this issue Oct 23, 2024 · 1 comment

Comments

@BillCarsonFr
Copy link

For example:

#[derive(Clone, uniffi::Enum)]
pub enum EventSendState {
  NotSentYet,
  SendingFailed {
        /// The error reason, with information for the user.
        error: QueueWedgeError,
  },
  ...
}

Where QueueWedgeError derives uniffi::Error

#[derive(uniffi::Error)]
pub enum QueueWedgeError 

Will generate a code that doesn' compile

undefined: FfiDestroyerTypeQueueWedgeError
cannot use FfiConverterTypeQueueWedgeErrorINSTANCE.Read(reader) (value of type *QueueWedgeError) as QueueWedgeError value in struct literal
cannot use variant_value.Error (variable of type QueueWedgeError) as *QueueWedgeError value in argument to FfiConverterTypeQueueWedgeErrorINSTANCE.Write

Sry but I don't know much about go.
Though it looks like it is related to the following issues?
#36
and maybe
#61

@BillCarsonFr BillCarsonFr changed the title Using an uniffi::Error inside a struc generates code that doesn't compile Using an uniffi::Error inside a struct generates code that doesn't compile Oct 23, 2024
@Lipt0nas
Copy link
Member

Hey, can you try using the new release v0.2.2+v0.25.0? It has fixes for error code generation

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

2 participants