Use cases for type lower bounds

question

#1

One can specify lower bounds for UnionAll types in v0.7 with >:.

I was trying to think about examples where I would use this feature, but could not come up with any. Looking at the sources in Base, I found this one, the rest of the applications look like compiler internals and tests.

If someone could explain some patterns that one would use >: for, or link some examples, I would be interested. My motivation is just trying to place a new language feature in my toolbox.


#2

One use case was mentioned in


#3

I guess AbstractArray{>:T} would also be useful in all cases where a function stores a value of type T inside an array provided as an argument. I’m not sure how common this is in practice, though.