opg icon indicating copy to clipboard operation
opg copied to clipboard

Enum without associated value, causes derive macro to hit "entered unreachable code" error

Open pawelchcki opened this issue 3 years ago • 1 comments

steps to reproduce:

Attempt to use enum like this one:

#[derive(Serialize, Deserialize, OpgModel)]
#[serde(tag = "req_type", content = "content")]
pub enum Repro {
    TypeA(),
    TybeB
}

Error:

error: proc-macro derive panicked
  --> src/data.rs:64:34
   |
64 | #[derive(Serialize, Deserialize, OpgModel)]
   |                                  ^^^^^^^^
   |
   = help: message: internal error: entered unreachable code

error: aborting due to previous error

error: could not compile `...`

Just encountered this error, using this awesome! crate. Haven't yet had time to dig deeper.

pawelchcki avatar Sep 06 '21 13:09 pawelchcki

Thanks for the report, will be fixed soon!

Rexagon avatar Sep 06 '21 13:09 Rexagon