quinnj / JSON3.jl

Other
214 stars 47 forks source link

no method matching JSON3.read(::Cmd, ::Type) #251

Open eugene-shvarts opened 1 year ago

eugene-shvarts commented 1 year ago

It looks like JSON3.read(cmd::Cmd) just does JSON3.read(Base.read(cmd, String)), but an oversight is that JSON3.read(cmd::Cmd, sometype::Type) doesn't yield JSON3.read(Base.read(cmd, String), sometype). This is an oversight and a one line fix with a new dispatch, right?

Currently:

julia> JSON3.read(`echo '"hello"'`)
"hello"

julia> JSON3.read(`echo '"hello"'`, String)
ERROR: MethodError: no method matching read(::Cmd, ::Type{String})
quinnj commented 1 year ago

Good catch! Mind making a PR to fix?

eugene-shvarts commented 1 year ago

@quinnj done!