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 doesn't call construct(T, args...; kw...) for Struct types #258

Open
EdsterG opened this issue May 9, 2023 · 1 comment
Open

Comments

@EdsterG
Copy link

EdsterG commented May 9, 2023

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

@quinnj
Copy link
Owner

quinnj commented May 22, 2023

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!

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

2 participants