<div dir="ltr">Yes, it does; as it does <span style="font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)">let</span><span style="color:rgb(0,0,0);font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures"> processedCars: [</span><span style="font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">Car</span><span style="color:rgb(0,0,0);font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures">] = </span><span style="font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">processAll</span><span style="color:rgb(0,0,0);font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures">(in: </span><span style="font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">vehicles</span><span style="color:rgb(0,0,0);font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures">, condition: </span><span style="font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">aboveSpeedLimit</span><span style="color:rgb(0,0,0);font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures">)</span><div><span style="color:rgb(0,0,0);font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures"><br></span></div><div><span style="font-variant-ligatures:no-common-ligatures"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.800000190734863px">The core of the matter is that it is nowhere stated in the call (expression) </span><span style="color:rgb(52,149,175);font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures">processAll</span><span style="color:rgb(0,0,0);font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures">(in: </span><span style="color:rgb(52,149,175);font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures">vehicles</span><span style="color:rgb(0,0,0);font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures">, condition: </span><span style="color:rgb(52,149,175);font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures">aboveSpeedLimit</span><span style="color:rgb(0,0,0);font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures">) </span><span style="font-size:12.800000190734863px">that the specialised version </span><span style="font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">processAll</span><span style="font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"><</span><span style="font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">Bicycle</span><span style="font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">> </span><span style="font-size:12.800000190734863px">is the one to be called. </span></span></div><div><span style="font-variant-ligatures:no-common-ligatures"><span style="font-size:12.800000190734863px"><br></span></span></div><div><span style="font-variant-ligatures:no-common-ligatures"><span style="font-size:12.800000190734863px">Although we are aware of the semantics, it does not read naturally and is somehow confusing. The ultimate goal is to make swift cleaner and clear. It rather feels like invoking non-specialised, non-generic function, and then casting the result to an array of a given type, which is not the case.</span><br></span></div><div><span style="font-variant-ligatures:no-common-ligatures"><span style="font-size:12.800000190734863px"><br></span></span></div><div><span style="font-variant-ligatures:no-common-ligatures"><span style="font-size:12.800000190734863px">All the best,</span></span></div><div><span style="font-variant-ligatures:no-common-ligatures"><span style="font-size:12.800000190734863px">Ramiro</span></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-11-22 12:09 GMT+11:00 Sean Heber <span dir="ltr"><<a href="mailto:sean@fifthace.com" target="_blank">sean@fifthace.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div>Doesn't this work?</div><div><br></div><div>processAll(in: vehicles, condition: aboveSpeedLimit) as [Bicycle]</div><div><br></div><div>l8r</div><div>Sean</div><div><br><div>Sent from my iPad</div></div><div><div class="h5"><div><br>On Nov 21, 2016, at 6:11 PM, Ramiro Feria Purón via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><span style="font-size:12.800000190734863px">Inferring the type of an expression from its surrounding context is not necessarily an ideal feature in a strongly typed programming language.</span><div style="font-size:12.800000190734863px"><br></div><div style="font-size:12.800000190734863px">The goal here is to be able to be explicit about the type, in an elegant and clear way, especially when there is no (need for a) context. </div><div style="font-size:12.800000190734863px"><br></div><div style="font-size:12.800000190734863px">Note that the <Type> "noise" would only be necessary when the type could not be inferred from the actual parameters (and if the current surrounding context type inference was removed, which is not part of the proposal).</div><div style="font-size:12.800000190734863px"><br></div><div style="font-size:12.800000190734863px">The line of code from the Motivation that does not compile is:</div><div style="font-size:12.800000190734863px"><br></div><div style="font-size:12.800000190734863px"><span style="font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">processAll</span><span style="font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"><</span><span style="font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">Bicycle</span><span style="font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">>(in: </span><span style="font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">vehicl<wbr>es</span><span style="font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">, condition: </span><span style="font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">aboveSpeedLimit</span><span style="font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">) </span><span style="color:rgb(0,143,0);font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures">// This should be allowed under this proposal</span><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-11-22 10:35 GMT+11:00 Adrian Zubarev <span dir="ltr"><<a href="mailto:adrian.zubarev@devandartist.com" target="_blank">adrian.zubarev@devandartist.<wbr>com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div class="m_1528253077411346657m_-7327322934150946090bloop_markdown"><p>I’m not sure what are you trying to solve here. Your code from the motivation compiles just fine in my Playground.</p>
<p>About the <code>g</code> function:</p>
<pre><code class="m_1528253077411346657m_-7327322934150946090swift">g(7) as [String]
let _: [String] = g(7)
</code></pre>
<p>Personally I don’t like to see <code><Type></code> noise on functions in Swift.</p>
<p></p></div><div class="m_1528253077411346657m_-7327322934150946090bloop_original_html"><div id="m_1528253077411346657m_-7327322934150946090bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div> <br> <div id="m_1528253077411346657m_-7327322934150946090bloop_sign_1479771201736640000" class="m_1528253077411346657m_-7327322934150946090bloop_sign"><div style="font-family:helvetica,arial;font-size:13px">-- <br>Adrian Zubarev<br>Sent with Airmail</div></div><div><div class="m_1528253077411346657h5"> <br><p class="m_1528253077411346657m_-7327322934150946090airmail_on">Am 22. November 2016 um 00:06:02, Ramiro Feria Purón via swift-evolution (<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>) schrieb:</p> </div></div><blockquote type="cite" class="m_1528253077411346657m_-7327322934150946090clean_bq"><span><div><div></div><div><div><div class="m_1528253077411346657h5">
<div dir="ltr"><b>Problem:</b>
<div><br></div>
<div>Currently, it is not possible to be explicit about the generic
parameters (type parameters) in a generic function call. Type
parameters are inferred from actual parameters:</div>
<div><br></div>
<div>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)">func</span>
<span style="font-variant-ligatures:no-common-ligatures">f<T>(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)">_</span>
<span style="font-variant-ligatures:no-common-ligatures">t:</span>
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">T</span><span style="font-variant-ligatures:no-common-ligatures">)
{</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0);min-height:13px">
<span style="font-variant-ligatures:no-common-ligatures">
</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,143,0)">
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">
</span> <span style="font-variant-ligatures:no-common-ligatures">//..</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures">}</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures"><br></span></p>
</div>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,143,0)">
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">f</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(5)
</span> <span style="font-variant-ligatures:no-common-ligatures">// T inferred to be
Int</span></p>
<div><span style="font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">
f</span><span style="font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(</span><span style="font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures;color:rgb(180,38,26)">"xzcvzxcvx"</span><span style="font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">) </span>
<span style="color:rgb(0,143,0);font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures">
// T inferred to be string</span> </div>
<div><br></div>
<div>If no type parameter is involved in the formal parameters, the
type parameter needs to be used somehow as part of the return type.
For example:</div>
<div><br></div>
<div>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)">func</span>
<span style="font-variant-ligatures:no-common-ligatures">g<T>(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)">_</span>
<span style="font-variant-ligatures:no-common-ligatures">x:</span>
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">Int</span><span style="font-variant-ligatures:no-common-ligatures">)
-> [</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">T</span><span style="font-variant-ligatures:no-common-ligatures">]
{</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0);min-height:13px">
<span style="font-variant-ligatures:no-common-ligatures">
</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures">
</span> <span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)">var</span>
<span style="font-variant-ligatures:no-common-ligatures">result:
[</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">T</span><span style="font-variant-ligatures:no-common-ligatures">]
= []</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0);min-height:13px">
<span style="font-variant-ligatures:no-common-ligatures">
</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,143,0)">
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">
</span> <span style="font-variant-ligatures:no-common-ligatures">//..</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0);min-height:13px">
<span style="font-variant-ligatures:no-common-ligatures">
</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures">
</span> <span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)">return</span>
<span style="font-variant-ligatures:no-common-ligatures">result</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures">}</span></p>
</div>
<div><br></div>
<div>In such cases, the type parameters must be inferrable from the
context:<br></div>
<div><br></div>
<div>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">g</span><span style="font-variant-ligatures:no-common-ligatures">(7)
</span> <span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,143,0)">//
Error: T cannot be inferred</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,143,0)">
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)">let</span>
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">array
=</span> <span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">g</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(7)
</span>
<span style="font-variant-ligatures:no-common-ligatures">// Error:
T cannot be inferred</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,143,0)">
</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)">let</span>
<span style="font-variant-ligatures:no-common-ligatures">array:
[</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">String</span><span style="font-variant-ligatures:no-common-ligatures">]
=</span> <span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">g</span><span style="font-variant-ligatures:no-common-ligatures">(7)
</span> <span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,143,0)">//
Ok: T inferred to be String</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,143,0)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)">
let</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> array
= </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">g</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"><</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">String</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">>(7)
</span><span style="font-variant-ligatures:no-common-ligatures">// Error: Cannot
explicitly specialise generic function</span><br></span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,143,0)">
<span style="font-variant-ligatures:no-common-ligatures"><br></span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,143,0)">
<span style="font-variant-ligatures:no-common-ligatures"><br></span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,143,0)">
<span style="font-variant-ligatures:no-common-ligatures"><br></span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,143,0)">
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small"><b>
Proposed Solution:</b></span></p>
<div><br></div>
<div>Allow explicit type parameters in generic function call:</div>
</div>
<div><br></div>
<div>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)">let</span>
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)">_</span>
<span style="font-variant-ligatures:no-common-ligatures">=</span>
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">g</span><span style="font-variant-ligatures:no-common-ligatures"><</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">String</span><span style="font-variant-ligatures:no-common-ligatures">>(7)
</span><span style="color:rgb(0,143,0)">// Ok</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures"><br></span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures"><br></span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures"><br></span></p>
<p style="margin:0px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures"><b style="color:rgb(34,34,34);font-family:arial,sans-serif">Motivation<span style="font-size:11px">:</span></b></span></p>
<div><br></div>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
</p>
<div>Consider the following contrived example:</div>
</div>
<div><br></div>
<div>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)">class</span>
<span style="font-variant-ligatures:no-common-ligatures">Vehicle
{</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures">
</span> <span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)">var</span>
<span style="font-variant-ligatures:no-common-ligatures">currentSpeed =
0</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,143,0)">
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">
</span> <span style="font-variant-ligatures:no-common-ligatures">//..</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures">}</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0);min-height:13px">
<br></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)">class</span>
<span style="font-variant-ligatures:no-common-ligatures">Bicycle:</span>
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">Vehicle</span>
<span style="font-variant-ligatures:no-common-ligatures">{</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,143,0)">
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">
</span> <span style="font-variant-ligatures:no-common-ligatures">//..</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures">}</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0);min-height:13px">
<br></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)">class</span>
<span style="font-variant-ligatures:no-common-ligatures">Car:</span>
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">Vehicle</span>
<span style="font-variant-ligatures:no-common-ligatures">{</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,143,0)">
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">
</span> <span style="font-variant-ligatures:no-common-ligatures">//..</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures">}</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures"><br></span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(4,51,255)">
<span style="font-variant-ligatures:no-common-ligatures">@discardableResult</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)">func</span>
<span style="font-variant-ligatures:no-common-ligatures">processAll<T:</span>
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">Vehicle</span><span style="font-variant-ligatures:no-common-ligatures">>(in
vehicles: [</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">Vehicle</span><span style="font-variant-ligatures:no-common-ligatures">],
condition: (</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">Vehicle</span><span style="font-variant-ligatures:no-common-ligatures">)
-></span> <span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">Bool</span><span style="font-variant-ligatures:no-common-ligatures">)
-> [</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">T</span><span style="font-variant-ligatures:no-common-ligatures">]
{</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0);min-height:13px">
<span style="font-variant-ligatures:no-common-ligatures">
</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures">
</span> <span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)">var</span>
<span style="font-variant-ligatures:no-common-ligatures">processed:
[</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">T</span><span style="font-variant-ligatures:no-common-ligatures">]
= []</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0);min-height:13px">
<span style="font-variant-ligatures:no-common-ligatures">
</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures">
</span> <span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)">for</span>
<span style="font-variant-ligatures:no-common-ligatures">vehicle</span>
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)">in</span>
<span style="font-variant-ligatures:no-common-ligatures">vehicles
{</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures">
</span> <span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)">guard</span>
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)">let</span>
<span style="font-variant-ligatures:no-common-ligatures">t =
vehicle</span> <span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)">as</span><span style="font-variant-ligatures:no-common-ligatures">?</span>
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">T</span><span style="font-variant-ligatures:no-common-ligatures">,
condition(vehicle)</span> <span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)">else</span>
<span style="font-variant-ligatures:no-common-ligatures">{</span>
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)">continue</span>
<span style="font-variant-ligatures:no-common-ligatures">}</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures">
</span> <span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,143,0)">//..</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures">
processed.</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">append</span><span style="font-variant-ligatures:no-common-ligatures">(t)</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures">
}</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0);min-height:13px">
<span style="font-variant-ligatures:no-common-ligatures">
</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures">
</span> <span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)">return</span>
<span style="font-variant-ligatures:no-common-ligatures">processed</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(4,51,255)">
</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures">}</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures"><br></span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)">func</span>
<span style="font-variant-ligatures:no-common-ligatures">aboveSpeedLimit(vehicle:</span>
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">Vehicle</span><span style="font-variant-ligatures:no-common-ligatures">)
-></span> <span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">Bool</span>
<span style="font-variant-ligatures:no-common-ligatures">{</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures">
</span> <span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)">return</span>
<span style="font-variant-ligatures:no-common-ligatures">vehicle.</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">currentSpeed</span><span style="font-variant-ligatures:no-common-ligatures"> >=
100</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures">}</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures"><br></span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures"><br></span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)">let</span>
<span style="font-variant-ligatures:no-common-ligatures">processedVehicles
=</span> <span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">processAll</span><span style="font-variant-ligatures:no-common-ligatures">(in:</span>
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">vehicles</span><span style="font-variant-ligatures:no-common-ligatures">,
condition:</span> <span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">aboveSpeedLimit</span><span style="font-variant-ligatures:no-common-ligatures">)
</span> <span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,143,0)">//
Uh, T inferred to be Vehicle!</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)">let</span>
<span style="font-variant-ligatures:no-common-ligatures">processedCars:
[</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">Car</span><span style="font-variant-ligatures:no-common-ligatures">]
=</span> <span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">processAll</span><span style="font-variant-ligatures:no-common-ligatures">(in:</span>
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">vehicles</span><span style="font-variant-ligatures:no-common-ligatures">,
condition:</span> <span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">aboveSpeedLimit</span><span style="font-variant-ligatures:no-common-ligatures">)
</span> <span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,143,0)">//
T inferred to be Car</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,143,0)">
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">processAll</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"><</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">Bicycle</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">>(in:</span>
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">vehicles</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">,
condition:</span> <span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">aboveSpeedLimit</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">)
</span> <span style="font-variant-ligatures:no-common-ligatures">// This should be
allowed under this proposal</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures"><br></span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures"><br></span></p>
<p style="margin:0px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures"><b style="color:rgb(34,34,34);font-family:arial,sans-serif">Notes<span style="font-size:11px">:</span></b></span></p>
<div><br></div>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)">
</p>
<div>If necessary, the (real life) Swift code that lead to the
proposal could be shared.</div>
</div>
<div><br></div>
</div></div></div>
______________________________<wbr>_________________<br>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailma<wbr>n/listinfo/swift-evolution</a><br></div></div></span></blockquote></div><div class="m_1528253077411346657m_-7327322934150946090bloop_markdown"><p></p></div></div></blockquote></div><br></div>
</div></blockquote><blockquote type="cite"><div><span>______________________________<wbr>_________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a></span><br></div></blockquote></div></div></div></blockquote></div><br></div>