How to avoid supplying exact types in a Dict constructor?

If you insist on this type signature, use

function Entities(resources::Dict{S,Vector{T}}) where {S <: Blueprint, T <: Entity}
    ...

See invariance.

That said, since you are traversing the input anyway, I think it is better to just allow all kinds of arguments that support pairs and use that interface.

1 Like