4 ms·
Which is only because Java doesn't understand contravariance. In Scala, that problem no longer exists.
by fnl 9y ago
Which is only because Java doesn't understand contravariance. In Scala, that problem no longer exists.
- kccqzy 9y agoNo. When references or arrays of references are treated as contravariant, you would have the opposite problem of ArrayReadException. You can now store things into arrays safely but you can no longer extract things from arrays safely.
- fnl 9y agoConsumers are contravariant in Scala, but producers are covariant. EDIT: Good reference: https://www.atlassian.com/blog/software-teams/covariance-and-contravariance-in-scala https://www.atlassian.com/blog/software-teams/covariance-and...