[swift-evolution] [Discussion] Updating Struct Values While Looping
Dmitri Gribenko
gribozavr at gmail.com
Mon Mar 7 11:11:12 CST 2016
On Mon, Mar 7, 2016 at 9:02 AM, Joe Groff <jgroff at apple.com> wrote:
>
>> On Mar 7, 2016, at 9:00 AM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
>>
>> On Mon, Mar 7, 2016 at 8:59 AM, Joe Groff <jgroff at apple.com> wrote:
>>>
>>> On Mar 7, 2016, at 2:24 AM, Dmitri Gribenko via swift-evolution
>>> <swift-evolution at swift.org> wrote:
>>>
>>> var a = [1,2,3]
>>> a.mutatingEach { (x: inout Int) -> Void in x += 1 }
>>> //a.mutatingEach { $0 += 1 } // does not work, probably due to a compiler
>>> bug.
>>> print(a)
>>>
>>>
>>> This should be fixed in 7.3, for what it's worth.
>>
>> I was testing on master.
>
> Sounds like we have a regression in master, then. It worked for me in a 7.3 beta playground.
https://bugs.swift.org/browse/SR-892
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-evolution
mailing list