[swift-users] Swift 4 "Cannot use mutating member on immutable value: 'self' is immutable"

Quinn "The Eskimo!" eskimo1 at apple.com
Mon Sep 18 08:24:44 CDT 2017

On 18 Sep 2017, at 13:52, Vladimir.S <svabox at gmail.com> wrote:

> Can't understand/accept this, sorry.

You seem to be very invested in how Swift /should/ work, rather than how it /does/ work.  I’m sympathetic with that position but it’s really a topic of conversation for swift-evolution rather than swift-users.

> Also, could you clarify, why .removeFirst() is different?

`removeFirst()` is marked as O(n), and thus it’s fully expected that it’d work on `Array`.

Share and Enjoy
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

More information about the swift-users mailing list