You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying this library out and I noticed that internal tagging is not deserializing properly. I get runtime errors after simply serializing to a JsValue and deserializing from it.
I looked through your code and found the internally tagged enum test, but it looks like you guys aren't expanding the #[serde(tag = "tag")] attribute in your test_enum! { ... } macro.
I started getting compile errors in the tests/serde.rs file after I added the expansion to the macro_rules block:
serde-wasm-bindgen$ wasm-pack test --node
[INFO]: Checking for the Wasm target...
Compiling serde-wasm-bindgen v0.1.3 (serde-wasm-bindgen)
error: #[serde(tag = "...")] cannot be used with tuple variants
error[E0277]: the trait bound `enums::InternallyTagged<(), ()>: enums::_IMPL_DESERIALIZE_FOR_ExternallyTagged::_serde::Serialize` is not satisfied
--> tests/serde.rs:89:23
|
39 | fn test_via_json<T>(value: T)
| -------------
40 | where
41 | T: Serialize + DeserializeOwned + PartialEq + Debug,
| --------- required by this bound in `test_via_json`
...
89 | test_via_json($name::Unit::<(), ()>);
| ^^^^^^^^^^^^^^^^^^^^^ the trait `enums::_IMPL_DESERIALIZE_FOR_ExternallyTagged::_serde::Serialize` is not implemented for `enums::InternallyTagged<(), ()>`
...
218 | / test_enum! {
219 | | #[serde(tag = "tag")]
220 | | InternallyTagged
221 | | }
| |_____- in this macro invocation
These errors do make sense because internally tagged enums don't work with tuple variants. It's just that they weren't being tested before.
I'm looking at this bug to see if I can fix it, but unfortunately I don't know much about serde. I'm not sure if it's a simple fix or not, but if I figure anything out I'll open a PR.
In the meantime, if you guys have any thoughts or guidance on this, I'd appreciate it!
The text was updated successfully, but these errors were encountered:
I was trying this library out and I noticed that internal tagging is not deserializing properly. I get runtime errors after simply serializing to a JsValue and deserializing from it.
I looked through your code and found the internally tagged enum test, but it looks like you guys aren't expanding the
#[serde(tag = "tag")]
attribute in yourtest_enum! { ... }
macro.I started getting compile errors in the tests/serde.rs file after I added the expansion to the macro_rules block:
Console output:
These errors do make sense because internally tagged enums don't work with tuple variants. It's just that they weren't being tested before.
I'm looking at this bug to see if I can fix it, but unfortunately I don't know much about serde. I'm not sure if it's a simple fix or not, but if I figure anything out I'll open a PR.
In the meantime, if you guys have any thoughts or guidance on this, I'd appreciate it!
The text was updated successfully, but these errors were encountered: