Skip to content

Instantly share code, notes, and snippets.

@d-date
Last active February 26, 2017 06:04
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 d-date/d1297541f288ea51bf5e34782709a250 to your computer and use it in GitHub Desktop.
Save d-date/d1297541f288ea51bf5e34782709a250 to your computer and use it in GitHub Desktop.
enum Sometype<T: SomeProtocol> {
case one
case two
case three
associatedtype Associated {
switch {
case .one: return One.self
case .two: return Two.self
case .three: retrun Three.self
}
}
}
protocol SomeProtocol {
}
struct One: SomeProtocol {
}
struct Two: SomeProtocol {
}
struct Three: SomeProtocol {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment