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

JSON3.read(str, MyStruct) does not roundtrip correctly nor error #285

Open
ericphanson opened this issue Aug 2, 2024 · 0 comments
Open

Comments

@ericphanson
Copy link

using StructTypes, JSON3

struct A
  a::Dict{Tuple{Int,Int}, Char}
end

StructTypes.StructType(::Type{A}) = StructTypes.Struct()

a = A(Dict((1, 2) => 'a', (2, 4) => 'b', (15, 20) => 'c'))

@show JSON3.read(JSON3.write(a), A)

results in

A(Dict((40, 50) => 'b', (40, 49) => 'c'))

IMO this should error instead.

From: https://discourse.julialang.org/t/json3-read-dict-tuple-int-int-t-unexpected-behavior/117759

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

1 participant