OxL Reference

error unknown-field

error Standard: [§4.2]

What it means#

The field name does not exist in the data type, in its embedded types (§4.7), or among the variant fields of the enum (§4.2, §4.4). It is reported for field access, for struct literals and for patterns.

Example#

oxl✓ checked in CI
data User {
  id: u64
  name: str
}

fn main() {
  let u = User{ id: 1, name: "Ann" }
  print(u.nmae)      // <- unknown-field
}
error
unknown-field

How to fix#

oxl✓ checked in CI
data User {
  id: u64
  name: str
}

fn main() {
  let u = User{ id: 1, name: "Ann" }
  print(u.name)
}

Correct the name, or add the field to the type.

See also#

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