[swift-users] function advancedBy() bugs

Dmitri Gribenko gribozavr at gmail.com
Tue May 17 11:02:29 CDT 2016


On Tue, May 17, 2016 at 5:46 AM, zh ao via swift-users
<swift-users at swift.org> wrote:
> It seams that I encountered bugs in function advancedBy().
>
> do {
>     var str = "abcdefg"
>     var range = str.startIndex..<str.endIndex // 0..<7
>     str += "hijklmn"
>     range.endIndex = str.endIndex // 0..<14
>     let index = range.startIndex.advancedBy(10)
>     //fatal error: cannot increment endIndex
> }

Hi,

Thank you for the report.  To me, this issue looks the same as
https://bugs.swift.org/browse/SR-1487.

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/


More information about the swift-users mailing list