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

missing constructfrom method for CustomStruct? #69

Open
ExpandingMan opened this issue Dec 9, 2021 · 1 comment
Open

missing constructfrom method for CustomStruct? #69

ExpandingMan opened this issue Dec 9, 2021 · 1 comment

Comments

@ExpandingMan
Copy link

Perhaps I'm misunderstanding the intention of CustomStruct but I believe it is missing a constructfrom method. Even after defining the required methods I get, e.g.

◖◗ ST.constructfrom(Dict{String,Any}, c)
ERROR: MethodError: no method matching constructfrom(::StructTypes.DictType, ::Type{Dict{String, Any}}, ::Type{String}, ::Type{Any}, ::StructTypes.CustomStruct, ::Column{Int64, Count})
Closest candidates are:
  constructfrom(::StructTypes.DictType, ::Type{T}, ::Type{K}, ::Type{V}, ::StructTypes.DictType, ::Any) where {T, K, V} at ~/.julia/packages/StructTypes/Cmlkm/src/StructTypes.jl:961
  constructfrom(::StructTypes.DictType, ::Type{T}, ::Type{K}, ::Type{V}, ::Union{StructTypes.Mutable, StructTypes.Struct}, ::Any) where {T, K, V} at ~/.julia/packages/StructTypes/Cmlkm/src/StructTypes.jl:978
  constructfrom(::StructTypes.DictType, ::Type{T}, ::Type{K}, ::Type{V}, ::S) where {T, K, V, S} at ~/.julia/packages/StructTypes/Cmlkm/src/StructTypes.jl:958
  ...
Stacktrace:
 [1] constructfrom
   @ ~/.julia/packages/StructTypes/Cmlkm/src/StructTypes.jl:958 [inlined]
 [2] constructfrom(#unused#::StructTypes.DictType, #unused#::Type{Dict{String, Any}}, obj::Column{Int64, Count})
   @ StructTypes ~/.julia/packages/StructTypes/Cmlkm/src/StructTypes.jl:955
 [3] constructfrom(#unused#::Type{Dict{String, Any}}, obj::Column{Int64, Count})
   @ StructTypes ~/.julia/packages/StructTypes/Cmlkm/src/StructTypes.jl:905
 [4] top-level scope
   @ REPL[13]:1

I had defined StructTypes.lowertype(::Type{<:Column}) = Dict{String,Any}, so I was expecting this to work.

@ExpandingMan
Copy link
Author

It might help to explain a bit more what I'm trying to do: I have a type Column{T,S} and I would like to serialize T,S as strings, but they are not involved in any field of the struct. As far as I can tell, this precludes the use of StructTypes.Struct().

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