OxL Reference

error unknown-method

error Standard: [§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✓ checked in CI
data User { name: str }

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

How to fix#

oxl✓ checked in 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 · Documentation version 1.0.0-beta© OxwaldLink · generated from the Standard, the std sources and the guides