2 ms·
My main point was that mutability and covariance are two orthogonal concepts that just happen to overlap here due to function signature shape. But it seems that
by PhilipRoman 2y ago
My main point was that mutability and covariance are two orthogonal concepts that just happen to overlap here due to function signature shape. But it seems that you are right, I cannot think of any expression that would type-check with Array<Animal> but not with Array<Cat>. ChatGPT was very unhelpful in trying to produce a counterexample, since it probably trained on too many entry level stackoverflow posts about this issue.