You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I might be wrong but it seems like we need to define a StructType for each and every parameterized parametric type?
using JSON3
struct MyParametricType{T}
t::TMyParametricType{T}(t) where {T} =new(t)
endMyParametricType(t::T) where {T} =MyParametricType{T}(t)
x =MyParametricType(1)
JSON3.StructType(::Type{MyParametricType}) = JSON3.Struct()
str = JSON3.write(x) # ERROR: ArgumentError: MyParametricType{String,Int64} doesn't have a defined `JSON3.StructType`
JSON3.StructType(::Type{MyParametricType{Int}}) = JSON3.Struct()
str = JSON3.write(x) # fine