Xo is experimental. The source code is not public yet; it will be soon. Read the release notes
Menu · XO0501

Docs

XO0501: var method called on a non var binding

error · reported by the checker

A method with a var receiver (including mutating collection methods such as push and put) changes the caller’s binding in place. It can be called only on a var binding, a var parameter, or a field of one. A Mutex.with closure parameter declared without var is a read only view. Declare the binding with var (the diagnostic offers that fix). See core 3.4 and 5.2.

Example

fn f() -> List[Int] {
  let xs = [1]
  xs.push(2)
  xs
}

Fix

fn f() -> List[Int] {
  var xs = [1]
  xs.push(2)
  xs
}

Run xo explain XO0501 for this text in a terminal, or see section 10.6 of the specification.