I've got an abstract type, with subtypes. I'd like to make and add to a Dict that holds the subtypes. Is this doable? What's a better way of achieving this?
Example:
abstract type Cat end
struct Lion <: Cat
manecolour
end
struct Tiger <: Cat
stripewidth
end
cats = Dict{Int, <:Cat}()
gives
ERROR: MethodError: no method matching Dict{Int64,var"#s3"} where var"#s3"<:Cat()
What's the more correct way of doing this?