Closed zot closed 2 years ago
This definition seems to capture both and also work:
StructTypes.constructfrom(::Struct, ::Type{ST}, ::Struct, obj::NamedTuple) where {ST <: NamedTuple} =
obj
This is just to make NamedTuple{}
work, like when you use a NamedTuple
as a kind of JS object. Going through the whole UnorderedStruct
process is better because it checks field by field...
I didn't see this issue before: https://github.com/JuliaData/StructTypes.jl/issues/68 -- I searched for named
and didn't find any matching issues -- didn't realize GitHub doesn't seem to match on partial words
After discussing examples with @zot, I think this is resolved in the latest release.
Hi, I'm getting this error trying to convert a NamedTuple to store in a NamedTuple field:
I made some definitions that seem to fix it, what do you think (seems like both
Struct
andUnorderedStruct
are needed)?