Closed
Description
Go does not support contravariance, specifically type Iterator interface { Next() interface{} } is not satisfied by func (s*WidgetList) Next() *Widget --- Supporting contravariance would: * Reduce the complexity of the language for the programmer (people assume things are contravariant, covariance is more nuanced). * Enable good collection classes to be implemented, which would likely either reduce the need for generics or point the way. * Should not be slower to compile than a call to Next().(*Widget). It may actually be faster, by allowing better caching. * Be reasonable in terms of implementation difficulty. I couldn't find a bug tracking this, so I'm opening this one!