-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
StaticArray serialization broken #15450
Comments
I think this is more of a feature because as you found out you can't currently deserialize into a |
|
Unfortunately, the |
I suppose we could serialize a sa = StaticArray(Int32, 2).new { |i| i }
json = sa.to_json # => "[0,1]" We could deserialize to a StaticArray(Int32, 2).from_json("[0,1]") # OK
StaticArray(Int32, 2).from_json("[0]") # ERROR
StaticArray(Int32, 2).from_json("[0,1,2]") # ERROR |
Serialization and specifically deserialization for @wolfgang371 Do you have a practical use case for this? |
@straight-shoota Well, I expected Crystal to have serialization to work out of the box for all internal types, including |
Yeah I guess it makes sense to have it. And it is possible to implement. I suppose there's some similarity to a |
Seems like serialization of
StaticArray
is broken.Just manually including the modules doesn't fix it.
Using
Crystal 1.15.1 [89944bf17] (2025-02-04), LLVM: 18.1.6, Default target: x86_64-unknown-linux-gnu
The text was updated successfully, but these errors were encountered: