Skip to content

Instantly share code, notes, and snippets.

@vasarhelyia
Last active October 16, 2015 23:44
Show Gist options
  • Select an option

  • Save vasarhelyia/ff8ad092a1a89451f64b to your computer and use it in GitHub Desktop.

Select an option

Save vasarhelyia/ff8ad092a1a89451f64b to your computer and use it in GitHub Desktop.
Missing covariant custom generic types
class πŸŽƒ {}
class πŸ‘» : πŸŽƒ {}
class πŸ‘Ή : πŸŽƒ {}
struct Party<T> {
let attendees:[T]
init(attendees:[T]) {
self.attendees = attendees
}
}
func guestList(party:Party<πŸŽƒ>) -> String {
return party.attendees.description
}
var attendees = Party(attendees:[πŸ‘»(), πŸ‘»()])
guestList(attendees)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment