OxL Справочник OxL
РусскийEnglish

error unknown-field

error Стандарт: [§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✓ проверяется в 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✓ проверяется в 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 · Версия документации 1.0.0-beta© OxwaldLink · сгенерировано из Стандарта, исходников std и руководства