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

Roundtrip is broken for Pair #10

Open
jamii opened this issue Aug 29, 2018 · 1 comment
Open

Roundtrip is broken for Pair #10

jamii opened this issue Aug 29, 2018 · 1 comment

Comments

@jamii
Copy link

jamii commented Aug 29, 2018

julia> p = (1 => 1)
1 => 1

julia> s = JSON2.write(p)
"{\"1\":1}"

julia> JSON2.read(s, typeof(p))
ERROR: MethodError: no method matching Pair{Int64,Int64}(::Int64)
Closest candidates are:
  Pair{Int64,Int64}(::Any, ::Any) where {A, B} at pair.jl:7
Stacktrace:
 [1] read(::Base.GenericIOBuffer{Array{UInt8,1}}, ::Type{Pair{Int64,Int64}}) at /home/jamie/.julia/packages/JSON2/LfBhC/src/read.jl:264
 [2] read(::String, ::Type) at /home/jamie/.julia/packages/JSON2/LfBhC/src/read.jl:50
 [3] top-level scope at none:0
@jamii
Copy link
Author

jamii commented Aug 29, 2018

[2535ab7d] JSON2 v0.2.1

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