Uploaded image for project: 'Swift'
  1. Swift
  2. SR-7177

Strange error when calling popFirst() on Array

    Details

      Description

      Welcome to Apple Swift version 4.0.3 (swiftlang-900.0.74.1 clang-900.0.39.2). Type :help for assistance.
        1> var a = [ 1,2,3,4 ]
      a: [Int] = 4 values {
        [0] = 1
        [1] = 2
        [2] = 3
        [3] = 4
      }
        2> a.popFirst()
      error: repl.swift:2:1: error: cannot use mutating member on immutable value: 'a' is immutable
      a.popFirst()
      ^
      

      I don't know, but something is going wrong here. `a` is obviously mutable.

        Attachments

          Activity

            People

            • Assignee:
              mdiep Matt Diephouse
              Reporter:
              helge Helge Heß
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: