palantir / conjure-rust

Conjure support for Rust
Apache License 2.0
20 stars 11 forks source link

Codegen for empty unions is broken #342

Closed sfackler closed 7 months ago

sfackler commented 7 months ago
   |
38 |                 let key = map.next_key()?;
   |                     ^^^
...
43 |                                 de::Unexpected::Str(key.as_str()),
   |                                                     --- type must be known at this point
   |
help: consider giving `key` an explicit type, where the placeholders `_` are specified
   |
38 |                 let key: std::option::Option<K> = map.next_key()?;
   |                        ++++++++++++++++++++++++

We should check both the exhaustive and non-exhaustive cases.