As it turns out, the rules for subtyping are not very straightforward. When you look at a simple type hierarchy, you can immediately tell whether one type is a subtype of another by tracing the relationships of the data types in the hierarchy. The situation becomes more complex when parametric types are involved. In this section, we will take a look at how Julia is designed with respect to variance, a concept that explains subtyping relationships for parametric types.
Let's first review the different kinds of variance.