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

Joe Groff jgroff at apple.com
Mon Mar 7 10:59:31 CST 2016


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

-Joe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160307/a5d37c43/attachment.html>


More information about the swift-evolution mailing list