4 ms·
No. As stated in the article, the array was not copied when it was assigned to var b as changes made to it via b also showed up in a.
by RayDonnelly 12y ago
No. As stated in the article, the array was not copied when it was assigned to var b as changes made to it via b also showed up in a.
- js2 12y agoWhich was a bug in beta 2 that was corrected in beta 3. So the behavior in beta 3 matches the design quoted above. Hence kipple is correct.
- josephlord 12y agoIt was a design bug not a implementation bug. Beta 2 behaviour matched the docs at that time but there was plenty of pushback about the behaviour in radars, Apple dev forums[0] and on the wider web[1]. Chris Lattner announced[0] the planned change on the forum 19th June. [0] https://devforums.apple.com/message/989944#989944 https://devforums.apple.com/message/989944#989944 [1] http://blog.human-friendly.com/swift-arrays-too-swift-and-flexible-for-our-good http://blog.human-friendly.com/swift-arrays-too-swift-and-fl...
- js2 12y agoThank you for the clarification.