3 ms·
Are you referring to "contravariance/covariance"? If so , is that the same as if I suggested that calling the Rectangle method `setWidth` on a Square should re
by ttymck 6y ago
Are you referring to "contravariance/covariance"?
If so , is that the same as if I suggested that calling the Rectangle method `setWidth` on a Square should return a Rectangle (that is _possibly_ a Square)?
i.e.
val mySquare: Square = new Square(20)
val myMutatedSquare: Rectangle = mySquare.setWidth(40) // 20 x 40