<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body 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><br>On Nov 21, 2016, at 6:11 PM, Ramiro Feria Purón via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; 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.&nbsp;</div><div style="font-size:12.800000190734863px"><br></div><div style="font-size:12.800000190734863px">Note that the &lt;Type&gt; "noise" would only be necessary when the type could not be inferred from the actual parameters (and if the current surrounding context&nbsp;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)">&lt;</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)">&gt;(in:&nbsp;</span><span style="font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">vehicles</span><span style="font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">, condition:&nbsp;</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)">) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</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">&lt;<a href="mailto:adrian.zubarev@devandartist.com" target="_blank">adrian.zubarev@devandartist.com</a>&gt;</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_-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_-7327322934150946090swift">g(7) as [String]  
let _: [String] = g(7)
</code></pre>

<p>Personally I don’t like to see <code>&lt;Type&gt;</code> noise on functions in Swift.</p>

<p></p></div><div class="m_-7327322934150946090bloop_original_html"><div id="m_-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_-7327322934150946090bloop_sign_1479771201736640000" class="m_-7327322934150946090bloop_sign"><div style="font-family:helvetica,arial;font-size:13px">--&nbsp;<br>Adrian Zubarev<br>Sent with Airmail</div></div><div><div class="h5"> <br><p class="m_-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_-7327322934150946090clean_bq"><span><div><div></div><div><div><div class="h5">





<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&lt;T&gt;(</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">&nbsp;&nbsp;
&nbsp;</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)">&nbsp;
&nbsp;</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)&nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</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)">)&nbsp;</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>&nbsp;</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&lt;T&gt;(</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">)
-&gt; [</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">&nbsp;&nbsp;
&nbsp;</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">&nbsp;
&nbsp;</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">&nbsp;&nbsp;
&nbsp;</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)">&nbsp;
&nbsp;</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">&nbsp;&nbsp;
&nbsp;</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">&nbsp;
&nbsp;</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)&nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp;</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)&nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</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)&nbsp;
&nbsp; &nbsp;</span> <span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,143,0)">//
Ok: T&nbsp;inferred to be&nbsp;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)">&nbsp;array
=&nbsp;</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)">&lt;</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)">&gt;(7)&nbsp;
&nbsp; &nbsp; &nbsp;&nbsp;</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">&lt;</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">String</span><span style="font-variant-ligatures:no-common-ligatures">&gt;(7)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</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">&nbsp;
&nbsp;</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)">&nbsp;
&nbsp;</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)">&nbsp;
&nbsp;</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)">&nbsp;
&nbsp;</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&lt;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">&gt;(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">)
-&gt;</span> <span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)">Bool</span><span style="font-variant-ligatures:no-common-ligatures">)
-&gt; [</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">&nbsp;&nbsp;
&nbsp;</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">&nbsp;
&nbsp;</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">&nbsp;&nbsp;
&nbsp;</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">&nbsp;
&nbsp;</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">&nbsp;
&nbsp; &nbsp; &nbsp;</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">&nbsp;
&nbsp; &nbsp; &nbsp;</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">&nbsp;
&nbsp; &nbsp; &nbsp; 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">&nbsp;
&nbsp; }</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">&nbsp;&nbsp;
&nbsp;</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">&nbsp;
&nbsp;</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">)
-&gt;</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">&nbsp;
&nbsp;</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">&nbsp;&gt;=
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">)&nbsp;
&nbsp; &nbsp; &nbsp;</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">)
&nbsp; &nbsp;</span> <span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,143,0)">//
T&nbsp;inferred to be&nbsp;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)">&lt;</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)">&gt;(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)">)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;</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/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br></div></div></span></blockquote></div><div class="m_-7327322934150946090bloop_markdown"><p></p></div></div></blockquote></div><br></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></body></html>