<div dir="ltr"><div>I&#39;ve noticed this current difference in behaviour.</div><div><br></div><div>Darwin:</div><div><br></div><div><div>$ swift</div><div>Welcome to Apple Swift version 4.0-dev (LLVM 2dedb62a0b, Clang b9d76a314c, Swift 6b4756bd93). Type :help for assistance.</div><div>  1&gt; import Foundation</div><div>  2&gt; &quot;abc&quot;.range(of: &quot;a&quot;)!.lowerBound..&lt;&quot;abc&quot;.range(of: &quot;a&quot;)!.upperBound</div><div>$R0: Range&lt;String.Index&gt; = {</div><div>  lowerBound = {</div><div>    _compoundOffset = 0</div><div>    _cache = utf16</div><div>  }</div><div>  upperBound = {</div><div>    _compoundOffset = 4</div><div>    _cache = utf16</div><div>  }</div><div>}</div></div><div><br></div><div>Linux:</div><div><br></div><div><div>$ swift</div><div>Welcome to Swift version 4.0-dev (LLVM 2dedb62a0b, Clang b9d76a314c, Swift 6b4756bd93). Type :help for assistance.</div><div>  1&gt; import Foundation </div><div>  2&gt; &quot;abc&quot;.range(of: &quot;a&quot;)!.lowerBound..&lt;&quot;abc&quot;.range(of: &quot;a&quot;)!.upperBound </div><div>$R0: CountableRange&lt;String.Index&gt; = {</div><div>  lowerBound = {</div><div>    _compoundOffset = 0</div><div>    _cache = utf16</div><div>  }</div><div>  upperBound = {</div><div>    _compoundOffset = 4</div><div>    _cache = utf16</div><div>  }</div><div>}</div></div><div><br></div><div>I think this might be because some changes made in the overlay (NSStringAPI.swift) haven&#39;t been ported across to swift-corelibs-foundation:</div><div><br></div><a href="https://github.com/apple/swift/commit/5f1c3f702189f8197e297479d464dc454330be80">https://github.com/apple/swift/commit/5f1c3f702189f8197e297479d464dc454330be80</a><br><br>Is my suspicion right, and is there any work in progress to bring this into sync before Swift 4?<div><br>-- <br>Ian Partridge</div></div>