<div dir="ltr">Excellent point Brent. I was considering that this would have to be an exact match, I hadn't considered the need for an <font face="monospace, monospace">(x: Y)</font> syntax.<div><br></div><div>This probably should be considered in a future proposal though. The future proposal may make sense to be after existential types are explored, so that common sub-types can be matched where there are associated-type requirements.</div><div><br></div><div>I'm a +1 on this proposal, I'm not sure if I need to say so, see the proposal for my analysis.<br><div><br></div></div><div>Thanks everyone for your comments so far!</div><div>Andrew Bennett</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 17, 2016 at 1:36 PM, Jordan Rose via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> On Mar 16, 2016, at 18:10 , Brent Royal-Gordon via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br>
><br>
>> • What is your evaluation of the proposal?<br>
><br>
> Good stuff.<br>
><br>
> How exact does the type match have to be? Can they be two subclasses of a different superclass? Can they conform to common protocols? Can they conform to no common protocols and just be `AnyObject` or `Any`?<br>
><br>
> Is there a way to specify the type, either to get an exact match or just to ask or a supertype? If you do that, does it have to be specified on both, or only one? Something like:<br>
><br>
> case let .Case1(x: SignedIntegerType, 2), let .Case2(2, x):<br>
<br>
</span>In GregT's current implementation, the types have to be an exact match. You can use the existing "as Foo" constraint to specify a type, but it must be specified everywhere that that wouldn't be the inferred type. (See my earlier message to Andrii C: <a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160314/012779.html" rel="noreferrer" target="_blank">https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160314/012779.html</a>) Note that that also isn't "as!"; if used with a subtype instead of a supertype, it imposes (and has always imposed) an additional constraint on the match.<br>
<br>
Jordan<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</div></div></blockquote></div><br></div>