Skip to content

Instantly share code, notes, and snippets.

@d-date
Last active February 26, 2017 06:04
Show Gist options
  • 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