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

error unknown-method

error Стандарт: [§4.5]

У типа нет такого метода.

What it means#

The method is not declared in an impl of the type, is not promoted from an embedded type (§4.7), and is not a default method of an interface the type satisfies (§4.6).

Example#

oxl✓ проверяется в CI
data User { name: str }

fn main() {
  let u = User{ name: "Ann" }
  u.greet()      // <- unknown-method
}
error
unknown-method

How to fix#

oxl✓ проверяется в CI
data User { name: str }

impl User {
  fn greet() -> str => "Hello, {name}"
}

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

Declare the method in an impl block, or call an existing one.

See also#

OxL 1.0.0-beta · Версия документации 1.0.0-beta© OxwaldLink · сгенерировано из Стандарта, исходников std и руководства