<div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif">You are right. Int conforms to Strideable.</div><div class="gmail_default" style="font-family:georgia,serif"><br></div><div class="gmail_default" style="font-family:georgia,serif">Now it seams like a bug. As in a playground. below are code works and doesn&#39;t work</div><div class="gmail_default" style="font-family:georgia,serif"><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(187,44,162)"><span style="">extension</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(112,61,170)">Int</span><span style="color:rgb(0,0,0)"> {</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="">    </span><span style="color:rgb(187,44,162)">func</span><span style=""> test() {</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="">        </span><span style="color:rgb(187,44,162)">let</span><span style=""> temp = stride(from:</span><span style="color:rgb(39,42,216)">1</span><span style="">, to:</span><span style="color:rgb(39,42,216)">10</span><span style="">, by:</span><span style="color:rgb(39,42,216)">2</span><span style="">) </span><span style="color:rgb(0,132,0)">// error</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="">    }</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="">}</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><br></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(187,44,162)"><span style="">extension</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(112,61,170)">Float</span><span style="color:rgb(0,0,0)"> {</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="">    </span><span style="color:rgb(187,44,162)">func</span><span style=""> test() {</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="">        </span><span style="color:rgb(187,44,162)">let</span><span style=""> temp = stride(from:</span><span style="color:rgb(39,42,216)">1</span><span style="">, to:</span><span style="color:rgb(39,42,216)">10</span><span style="">, by:</span><span style="color:rgb(39,42,216)">2</span><span style="">) </span><span style="color:rgb(0,132,0)">// error</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="">    }</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="">}</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><br></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(187,44,162)"><span style="">extension</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(112,61,170)">String</span><span style="color:rgb(0,0,0)"> {</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="">    </span><span style="color:rgb(187,44,162)">func</span><span style=""> test() {</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="">        </span><span style="color:rgb(187,44,162)">let</span><span style=""> temp = </span><span style="color:rgb(61,29,129)">stride</span><span style="">(from:</span><span style="color:rgb(39,42,216)">1</span><span style="">, to:</span><span style="color:rgb(39,42,216)">10</span><span style="">, by:</span><span style="color:rgb(39,42,216)">2</span><span style="">) </span><span style="color:rgb(0,132,0)">// works</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="">    }</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="">}</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><br></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(187,44,162)"><span style="">class</span><span style="color:rgb(0,0,0)"> A {</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><span style="">    </span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="">}</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><br></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(187,44,162)"><span style="">extension</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(79,129,135)">A</span><span style="color:rgb(0,0,0)"> {</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="">    </span><span style="color:rgb(187,44,162)">func</span><span style=""> test() {</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="">        </span><span style="color:rgb(187,44,162)">let</span><span style=""> temp = </span><span style="color:rgb(61,29,129)">stride</span><span style="">(from:</span><span style="color:rgb(39,42,216)">1</span><span style="">, to:</span><span style="color:rgb(39,42,216)">10</span><span style="">, by:</span><span style="color:rgb(39,42,216)">2</span><span style="">) </span><span style="color:rgb(0,132,0)">// works</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="">    }</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="">}</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><br></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(187,44,162)"><span style="">struct</span><span style="color:rgb(0,0,0)"> B {</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><span style="">    </span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="">}</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><br></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(187,44,162)"><span style="">extension</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(79,129,135)">B</span><span style="color:rgb(0,0,0)"> {</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="">    </span><span style="color:rgb(187,44,162)">func</span><span style=""> test() {</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="">        </span><span style="color:rgb(187,44,162)">let</span><span style=""> temp = </span><span style="color:rgb(61,29,129)">stride</span><span style="">(from:</span><span style="color:rgb(39,42,216)">1</span><span style="">, to:</span><span style="color:rgb(39,42,216)">10</span><span style="">, by:</span><span style="color:rgb(39,42,216)">2</span><span style="">) </span><span style="color:rgb(0,132,0)">// works</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="">    }</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="">}</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><br></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="color:rgb(187,44,162)">func</span><span style=""> test() {</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="">    </span><span style="color:rgb(187,44,162)">let</span><span style=""> temp = </span><span style="color:rgb(61,29,129)">stride</span><span style="">(from:</span><span style="color:rgb(39,42,216)">1</span><span style="">, to:</span><span style="color:rgb(39,42,216)">10</span><span style="">, by:</span><span style="color:rgb(39,42,216)">2</span><span style="">) </span><span style="color:rgb(0,132,0)">//works</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="">}</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><br></p></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="color:rgb(187,44,162)">let</span><span style=""> temp = </span><span style="color:rgb(61,29,129)">stride</span><span style="">(from:</span><span style="color:rgb(39,42,216)">1</span><span style="">, to:</span><span style="color:rgb(39,42,216)">10</span><span style="">, by:</span><span style="color:rgb(39,42,216)">2</span><span style="">) </span><span style="color:rgb(0,132,0)">// works</span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="color:rgb(0,132,0)"><br></span></p></div></blockquote><font color="#000000" face="georgia, serif"><div class="gmail_default" style="display:inline">​It is nothing bug a bug?​</div><br></font><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="color:rgb(0,132,0)"><br></span></p></div></blockquote><div class="gmail_default" style="display:inline"><font color="#000000" face="georgia, serif">​Zhaoxin​</font></div><br><div class="gmail_default" style="font-family:georgia,serif">




<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><span style=""></span></p>
</div><div class="gmail_default" style="font-family:georgia,serif">




<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><span style=""></span></p>
</div><div class="gmail_default" style="font-family:georgia,serif">




<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><span style=""></span></p>
</div><div class="gmail_default" style="font-family:georgia,serif">


<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><span style=""></span></p>
</div><div class="gmail_default" style="font-family:georgia,serif">




<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><span style=""></span></p>
</div><div class="gmail_default" style="font-family:georgia,serif">


<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><span style=""></span></p>
</div><div class="gmail_default" style="font-family:georgia,serif">




<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><span style=""></span></p>
</div><div class="gmail_default" style="font-family:georgia,serif">


<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><span style=""></span></p>
</div><div class="gmail_default" style="font-family:georgia,serif"><div><span style="color:rgb(0,132,0)"><br></span></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 5, 2016 at 10:16 PM, Shawn Erickson <span dir="ltr">&lt;<a href="mailto:shawnce@gmail.com" target="_blank">shawnce@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Int conforms to Strideable byway of Integer &lt;- SignedInteger &lt;- Int (not exactly sure how it will be once the integer proposal is implemented but it will still be strideable).<span class="HOEnZb"><font color="#888888"><br><br>-Shawn</font></span><div class="HOEnZb"><div class="h5"><br><div class="gmail_quote"><div dir="ltr">On Mon, Jul 4, 2016 at 10:38 PM Zhao Xin via swift-users &lt;<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif">In Swift 3, </div><div class="gmail_default" style="font-family:georgia,serif"><span style="font-family:&#39;SF Mono&#39;,Menlo,monospace;font-size:14px;color:rgb(170,13,145)"><br></span></div><div class="gmail_default" style="font-family:georgia,serif"><span style="font-family:&#39;SF Mono&#39;,Menlo,monospace;font-size:14px;color:rgb(170,13,145)">func</span><span style="font-family:&#39;SF Mono&#39;,Menlo,monospace;color:rgb(51,51,51);font-size:14px;background-color:rgb(250,250,250)"> </span><span style="font-family:&#39;SF Mono&#39;,Menlo,monospace;font-size:14px;color:rgb(0,0,0)">stride</span><span style="font-family:&#39;SF Mono&#39;,Menlo,monospace;color:rgb(51,51,51);font-size:14px;background-color:rgb(250,250,250)">&lt;</span><span style="font-family:&#39;SF Mono&#39;,Menlo,monospace;font-size:14px;color:rgb(0,0,0)">T</span><span style="font-family:&#39;SF Mono&#39;,Menlo,monospace;color:rgb(51,51,51);font-size:14px;background-color:rgb(250,250,250)"> : </span><span style="font-family:&#39;SF Mono&#39;,Menlo,monospace;font-size:14px;color:rgb(92,38,153)"><a style="color:rgb(92,38,153);text-decoration:none">Strideable</a></span><span style="font-family:&#39;SF Mono&#39;,Menlo,monospace;color:rgb(51,51,51);font-size:14px;background-color:rgb(250,250,250)">&gt;(</span><span style="font-family:&#39;SF Mono&#39;,Menlo,monospace;font-size:14px;color:rgb(0,0,0)">from</span><span style="font-family:&#39;SF Mono&#39;,Menlo,monospace;color:rgb(51,51,51);font-size:14px;background-color:rgb(250,250,250)"> </span><span style="font-family:&#39;SF Mono&#39;,Menlo,monospace;color:rgb(51,51,51);font-size:14px">start</span><span style="font-family:&#39;SF Mono&#39;,Menlo,monospace;color:rgb(51,51,51);font-size:14px;background-color:rgb(250,250,250)">: T, </span><span style="font-family:&#39;SF Mono&#39;,Menlo,monospace;font-size:14px;color:rgb(0,0,0)">to</span><span style="font-family:&#39;SF Mono&#39;,Menlo,monospace;color:rgb(51,51,51);font-size:14px;background-color:rgb(250,250,250)"> </span><span style="font-family:&#39;SF Mono&#39;,Menlo,monospace;color:rgb(51,51,51);font-size:14px">end</span><span style="font-family:&#39;SF Mono&#39;,Menlo,monospace;color:rgb(51,51,51);font-size:14px;background-color:rgb(250,250,250)">: T, </span><span style="font-family:&#39;SF Mono&#39;,Menlo,monospace;font-size:14px;color:rgb(0,0,0)">by</span><span style="font-family:&#39;SF Mono&#39;,Menlo,monospace;color:rgb(51,51,51);font-size:14px;background-color:rgb(250,250,250)"> </span><span style="font-family:&#39;SF Mono&#39;,Menlo,monospace;color:rgb(51,51,51);font-size:14px">stride</span><span style="font-family:&#39;SF Mono&#39;,Menlo,monospace;color:rgb(51,51,51);font-size:14px;background-color:rgb(250,250,250)">: T.Stride) -&gt; </span><span style="font-family:&#39;SF Mono&#39;,Menlo,monospace;font-size:14px;color:rgb(92,38,153)"><a style="color:rgb(92,38,153);text-decoration:none">StrideTo</a></span><span style="font-family:&#39;SF Mono&#39;,Menlo,monospace;color:rgb(51,51,51);font-size:14px;background-color:rgb(250,250,250)">&lt;T&gt;</span></div><div class="gmail_default" style="font-family:georgia,serif"><span style="font-family:&#39;SF Mono&#39;,Menlo,monospace;color:rgb(51,51,51);font-size:14px;background-color:rgb(250,250,250)"><br></span></div><div class="gmail_default"><font color="#333333" face="SF Mono, Menlo, monospace"><span style="background-color:rgb(250,250,250)">Int does not </span>conform to Strideable. </font></div><div class="gmail_default"><font color="#333333" face="SF Mono, Menlo, monospace"><span style="font-size:14px"><br></span></font></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default"><font color="#333333" face="SF Mono, Menlo, monospace"><span style="font-size:14px"><div class="gmail_default">Adopted By</div></span></font></div><div class="gmail_default"><font color="#333333" face="SF Mono, Menlo, monospace"><span style="font-size:14px"><div class="gmail_default"><br></div></span></font></div><div class="gmail_default"><font color="#333333" face="SF Mono, Menlo, monospace"><span style="font-size:14px"><div class="gmail_default">CGFloat</div></span></font></div><div class="gmail_default"><font color="#333333" face="SF Mono, Menlo, monospace"><span style="font-size:14px"><div class="gmail_default">Decimal</div></span></font></div><div class="gmail_default"><font color="#333333" face="SF Mono, Menlo, monospace"><span style="font-size:14px"><div class="gmail_default">Double</div></span></font></div><div class="gmail_default"><font color="#333333" face="SF Mono, Menlo, monospace"><span style="font-size:14px"><div class="gmail_default">Float</div></span></font></div><div class="gmail_default"><font color="#333333" face="SF Mono, Menlo, monospace"><span style="font-size:14px"><div class="gmail_default">Float80</div></span></font></div><div class="gmail_default"><font color="#333333" face="SF Mono, Menlo, monospace"><span style="font-size:14px"><div class="gmail_default">String.UTF16View.Index</div></span></font></div><div class="gmail_default"><font color="#333333" face="SF Mono, Menlo, monospace"><span style="font-size:14px"><div class="gmail_default">UnsafeMutablePointer</div></span></font></div><div class="gmail_default"><font color="#333333" face="SF Mono, Menlo, monospace"><span style="font-size:14px"><div class="gmail_default">UnsafePointer</div><div class="gmail_default"><br></div></span></font></div></blockquote><font color="#333333" face="SF Mono, Menlo, monospace"><span style="font-size:14px"><div class="gmail_default" style="font-family:georgia,serif;display:inline">​In Swift 2.2,</div></span></font><div><font color="#333333" face="SF Mono, Menlo, monospace"><span style="font-size:14px"><div class="gmail_default" style="font-family:georgia,serif;display:inline"><br></div></span></font></div><div><span style="background-color:transparent;border:0px;font-size:12px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(170,51,145);font-family:Menlo,monospace">@warn_unused_result</span><span style="color:rgb(0,0,0);font-family:Menlo,monospace;font-size:12px"> </span><span style="background-color:transparent;border:0px;font-size:12px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(170,51,145);font-family:Menlo,monospace">func</span><span style="color:rgb(0,0,0);font-family:Menlo,monospace;font-size:12px"> </span><span style="background-color:transparent;border:0px;font-size:12px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(0,0,0);font-family:Menlo,monospace">stride</span><span style="color:rgb(0,0,0);font-family:Menlo,monospace;font-size:12px">(</span><span style="background-color:transparent;border:0px;font-size:12px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(0,0,0);font-family:Menlo,monospace">to</span><span style="color:rgb(0,0,0);font-family:Menlo,monospace;font-size:12px"> </span><code style="background-color:transparent;border:0px;font-size:12px;margin:0px 0px 15px;outline:0px;padding:0px 0px 6px;vertical-align:baseline;color:rgb(0,0,0);font-family:Menlo,monospace;word-wrap:break-word"><em style="background-color:transparent;border:0px;font-size:0.92307em;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(65,65,65);line-height:1.5">end</em></code><span style="color:rgb(0,0,0);font-family:Menlo,monospace;font-size:12px">: </span><span style="background-color:rgb(255,255,255);border:0px;font-size:12px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(92,38,153);font-family:Menlo,monospace">Self</span><span style="color:rgb(0,0,0);font-family:Menlo,monospace;font-size:12px">, </span><span style="background-color:transparent;border:0px;font-size:12px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(0,0,0);font-family:Menlo,monospace">by</span><span style="color:rgb(0,0,0);font-family:Menlo,monospace;font-size:12px"> </span><code style="background-color:transparent;border:0px;font-size:12px;margin:0px 0px 15px;outline:0px;padding:0px 0px 6px;vertical-align:baseline;color:rgb(0,0,0);font-family:Menlo,monospace;word-wrap:break-word"><em style="background-color:transparent;border:0px;font-size:0.92307em;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(65,65,65);line-height:1.5">stride</em></code><span style="color:rgb(0,0,0);font-family:Menlo,monospace;font-size:12px">: </span><span style="background-color:rgb(255,255,255);border:0px;font-size:12px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(92,38,153);font-family:Menlo,monospace">Self</span><span style="color:rgb(0,0,0);font-family:Menlo,monospace;font-size:12px">.</span><span style="background-color:rgb(255,255,255);border:0px;font-size:12px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(92,38,153);font-family:Menlo,monospace">Stride</span><span style="color:rgb(0,0,0);font-family:Menlo,monospace;font-size:12px">) -&gt; </span><span style="background-color:rgb(255,255,255);border:0px;font-size:12px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(92,38,153);font-family:Menlo,monospace"><a style="background-color:transparent;border:0px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:inherit;text-decoration:none">StrideTo</a></span><span style="color:rgb(0,0,0);font-family:Menlo,monospace;font-size:12px">&lt;</span><span style="background-color:rgb(255,255,255);border:0px;font-size:12px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(92,38,153);font-family:Menlo,monospace">Self</span><span style="color:rgb(0,0,0);font-family:Menlo,monospace;font-size:12px">&gt;</span></div><div><font color="#333333" face="SF Mono, Menlo, monospace"><span style="font-size:14px"><div class="gmail_default" style="font-family:georgia,serif;display:inline"><br></div></span></font></div><div><font color="#333333" face="SF Mono, Menlo, monospace"><span style="font-size:14px"><div class="gmail_default" style="font-family:georgia,serif;display:inline">It uses Self, which means the type of the variable, instead of T.</div></span></font></div><div><div class="gmail_default"><font color="#333333" face="SF Mono, Menlo, monospace"><span style="font-size:14px"><br></span></font></div><div class="gmail_default"><font color="#333333" face="SF Mono, Menlo, monospace"><span style="font-size:14px">Zhaoxin</span></font></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 5, 2016 at 11:41 AM, Adriano Ferreira via swift-users <span dir="ltr">&lt;<a href="mailto:swift-users@swift.org" target="_blank">swift-users@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"><div style="word-wrap:break-word"><div>Hi everyone!</div><div><br></div><div>I’m converting some code to Swift 3 and got this issue?</div><div><br></div><div><br></div><div><img height="95" width="822"></div><div><br></div><div><br></div><div>Does anybody know what’s going on?</div><div><br></div><div>Here’s the code, before and after conversion:</div><div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><br></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><br></div></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><div style="font-family:Helvetica;font-size:12px"><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="color:rgb(0,132,0)">// Swift 2.2</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(187,44,162)"><span>extension</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(112,61,170)">Int</span><span style="color:rgb(0,0,0)"> {</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><br><span></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span style="color:rgb(0,0,0)">    </span><span>// Repeat a block of code from `self` up to a limit</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span>    </span><span style="color:rgb(187,44,162)">func</span><span> up(to upper: </span><span style="color:rgb(112,61,170)">Int</span><span>, by step: </span><span style="color:rgb(112,61,170)">Int</span><span> = </span><span style="color:rgb(39,42,216)">1</span><span>, </span><span style="color:rgb(187,44,162)">@noescape</span><span> closure:</span><span> () -&gt; </span><span style="color:rgb(112,61,170)">Void</span><span>) {</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><span></span><br></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span>        </span><span style="color:rgb(187,44,162)">for</span><span> </span><span style="color:rgb(187,44,162)">_</span><span> </span><span style="color:rgb(187,44,162)">in</span><span> <span style="color:rgb(187,44,162)">self</span><span>.</span>stride(</span><span>to: upper, by: step) {</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span>            closure()</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span>        }</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span>    }</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span>}</span></div><div><span><br></span></div><div><span><div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="color:rgb(0,132,0)">// Swift 3</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(187,44,162)"><span>extension</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(112,61,170)">Int</span><span style="color:rgb(0,0,0)"> {</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><br><span></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span style="color:rgb(0,0,0)">    </span><span>// Repeat a block of code from `self` up to a limit</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span>    </span><span style="color:rgb(187,44,162)">func</span><span> up(to upper: </span><span style="color:rgb(112,61,170)">Int</span><span>, by step: </span><span style="color:rgb(112,61,170)">Int</span><span> = </span><span style="color:rgb(39,42,216)">1</span><span>, </span><span style="color:rgb(187,44,162)">_</span><span> closure: </span><span style="color:rgb(187,44,162)">@noescape</span><span> () -&gt; </span><span style="color:rgb(112,61,170)">Void</span><span>) {</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><span></span><br></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span>        </span><span style="color:rgb(187,44,162)">for</span><span> </span><span style="color:rgb(187,44,162)">_</span><span> </span><span style="color:rgb(187,44,162)">in</span><span> stride(from: </span><span style="color:rgb(187,44,162)">self</span><span>, to: upper, by: step) {</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span>            closure()</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span>        }</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span>    }</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span>}</span></div></div><div><span><br></span></div></span></div><div><span><br></span></div><div><span><span style="color:rgb(0,132,0);font-family:Menlo;font-size:11px">// Usage</span></span></div><div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="color:#272ad8">1</span><span>.</span><span style="color:#31595d">up</span><span>(to: </span><span style="color:#272ad8">10</span><span>, by: </span><span style="color:#272ad8">2</span><span>) {</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span>    </span><span style="color:#3d1d81">print</span><span>(</span><span style="color:#d12f1b">&quot;Hi!&quot;</span><span>)</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span>}</span></div></div></div></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span><br></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span><br></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-family:Helvetica;font-size:12px">Best,</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-family:Helvetica;font-size:12px"><br></span></div><div style="margin:0px;line-height:normal">— A</div></div><br>_______________________________________________<br>
swift-users mailing list<br>
<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-users</a><br>
<br></blockquote></div><br></div>
_______________________________________________<br>
swift-users mailing list<br>
<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-users</a><br>
</blockquote></div>
</div></div></blockquote></div><br></div>