[swift-evolution] [Discussion] Updating Struct Values While Looping

Joe Groff jgroff at apple.com
Mon Mar 7 11:02:56 CST 2016


> 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.

-Joe


More information about the swift-evolution mailing list