<div dir="ltr">Excellent point Brent. I was considering that this would have to be an exact match, I hadn&#39;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&#39;m a +1 on this proposal, I&#39;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">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
&gt; On Mar 16, 2016, at 18:10 , Brent Royal-Gordon via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt;      • What is your evaluation of the proposal?<br>
&gt;<br>
&gt; Good stuff.<br>
&gt;<br>
&gt; 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>
&gt;<br>
&gt; 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>
&gt;<br>
&gt;       case let .Case1(x: SignedIntegerType, 2), let .Case2(2, x):<br>
<br>
</span>In GregT&#39;s current implementation, the types have to be an exact match. You can use the existing &quot;as Foo&quot; constraint to specify a type, but it must be specified everywhere that that wouldn&#39;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&#39;t &quot;as!&quot;; 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>