JSON3.jl icon indicating copy to clipboard operation
JSON3.jl copied to clipboard

`JSON3.read` doesn't call `construct(T, args...; kw...)` for `Struct` types

Open EdsterG opened this issue 1 year ago • 1 comments

It calls the object constructor but not StructTypes.construct, which violates the StructTypes API.

EdsterG avatar May 09 '23 03:05 EdsterG

Ah, this is actually a bug in StructTypes itself, the definition of @inline function construct(values::Vector{Any}, ::Type{T}) where {T} takes a Vector{Any} and constructs T, but doesn't call construct, it just calls T(...). Should be pretty easy to fix if someone wants to make a PR to StructTypes.jl.

Thanks for reporting!

quinnj avatar May 22 '23 23:05 quinnj