[swift-evolution] Make generics covariant and add generics to protocols

Thorsten Seitz tseitz42 at icloud.com
Tue Jan 12 23:50:39 CST 2016


Strong -1 from me as well for making the type system unsound.

> Am 13.01.2016 um 02:47 schrieb Howard Lovatt via swift-evolution <swift-evolution at swift.org>:
> 
> Yes you can annotate for covariance, invariance, and contravariance, both Java and Scala, allow all three. The problem is that the code becomes splattered with variance annotations

Ceylon uses a different approach which is variance annotations at the definition site.
This restricts the possible usage of the type parameters to appropriately variant positions.

This migt be a better way to deal with variance.

-Thorsten


More information about the swift-evolution mailing list