Skip to content

Instantly share code, notes, and snippets.

@jspahrsummers
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jspahrsummers/cb9ae22c0fd0da0d539b to your computer and use it in GitHub Desktop.
Save jspahrsummers/cb9ae22c0fd0da0d539b to your computer and use it in GitHub Desktop.
Covariance + generics = 😢
class Stream<T> {
// But I want `Stream<U>` to instead be typed as whatever subclass this is invoked upon
func map<U>(f: T -> U) -> Stream<U>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment