OxL Reference

error not-assignable

error Standard: [§5.1]

What it means#

The left side of = or a compound assignment MUST be a mutable place: a var variable, a field of one, or an element accessed through &var (§5.1). A call result, a literal or an arithmetic expression is not a place. (Assignment to an existing immutable let binding is mutate-immutable.)

Example#

oxl✓ checked in CI
fn total() -> i32 => 10

fn main() {
  total() = 5      // <- not-assignable
}
error
not-assignable

How to fix#

oxl✓ checked in CI
fn main() {
  var total = 10
  total = 5
}

Assign to a variable, field or element instead of an expression value.

See also#

OxL 1.0.0-beta · Documentation version 1.0.0-beta© OxwaldLink · generated from the Standard, the std sources and the guides