> parameters should be contravariant
Always? In that case, do you know why Dart has a `covariant` keyword [0], which makes function parameters covariant?
Always? In that case, do you know why Dart has a `covariant` keyword [0], which makes function parameters covariant?
If we consider inside the function:
However, outside of the function, when calling it, the opposite is true. It's easy to get them mixed up when looking at it from the wrong perspective - but we should be looking at functions from the outside, not the inside - so yes, parameters should be contravariant and return types covariant.