Closed EricForgy closed 3 years ago
Because you subtype AbstractArray
, your type will naturally be treated "array-like". It seems you're trying to override this by defining StructTypes.StructType
, but the issue there is you're defining it specifically on the abstract type MyStruct
, whereas the call of JSON3.write
will end up being something like StructTypes.StructType(MyStruct{Int, Int, 1})
. So in order to catch "all" the parameterizations of your struct, you'd want something like StructTypes.StructType(::Type{<:MyStruct}) = StructTypes.Struct()
That did the trick. Thank you @quinnj 🙌
I was pulling my hair out, but I needed the <:
🤦
Hi 👋
Apologies if this is covered elsewhere, but wanted to leave a quick note:
With above, I'm getting:
I expect
What am I missing?