<div dir="ltr"><div>Hello everyone,</div><div><br></div>This is a great proposal and indeed it would be nice to have this feature in Swift.<div><br></div><div>However, there is another use case I have in mind. It would be nice to match multiple cases with associated values of different types which conform to a certain protocol.</div><div><br></div><div>I&#39;ll illustrate with an example. Suppose I am implementing REST API requests using enums.</div><div><br></div><div>protocol Serializable {</div><div>  func serialize() -&gt; NSData</div><div>}</div><div><br></div><div>struct CreateFooRequest: Serializable {</div><div>  let title: String</div><div>  let date: NSDate</div><div>}</div><div><br></div><div><div>struct UpdateFooRequest: Serializable {}</div></div><div><br></div><div>...</div><div><br></div><div>enum APIRequest {</div><div>    case .CreateFoo(request: CreateFooRequest),</div><div><div>    case .UpdateFoo(request: UpdateFooRequest)</div></div><div>    ...</div><div><br></div><div><div>    var HTTPRequest: NSHTTPRequest { ... }</div></div><div><br></div><div>    var URL: NSURL { ... }</div><div><br></div><div>    var headers: [String: String] { ... }</div><div><br></div><div>    var HTTPBody: NSData? {</div><div>        switch self {</div><div>          case let .CreateFoo(request): </div><div>            return request.serialize()</div><div>          case let .UpdateFoo(request): </div><div>            return request.serialize()</div><div>          ...</div><div>        }<br></div><div>    }</div><div>}<br></div><div><br></div><div>Current proposal aims to eliminate repetitiveness such as in the HTTPBody property of the APIRequest enum, but does it cover the case where associated value types are different, but conform to the same protocol? It is not clear to me.</div><div><br></div><div>Just in case, here&#39;s the link to the proposal: <a href="https://github.com/apple/swift-evolution/pull/119">https://github.com/apple/swift-evolution/pull/119</a></div></div>