Skip to content

Instantly share code, notes, and snippets.

@kongtomorrow
Last active August 29, 2015 14:23
Show Gist options
  • Select an option

  • Save kongtomorrow/77c53e32ecf50b94f3c1 to your computer and use it in GitHub Desktop.

Select an option

Save kongtomorrow/77c53e32ecf50b94f3c1 to your computer and use it in GitHub Desktop.
associated types for Brent
protocol Value {
}
protocol Smashable {
typealias V : Value
func valueBySmashing​OtherValue​(value: V) -> V
}
struct Bar : Value {
}
struct Foo : Value {
func valueBySmashing​OtherValue​<OtherV : Value>(value: OtherV) -> Bar {
return Bar()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment