OxL Reference

error missing-override

error Standard: [§4.7]

What it means#

If an outer type declares a method with the same name as an open fn of an embedded type, it MUST say override and repeat the signature exactly (§4.7). Silent shadowing would change dispatch without the reader noticing.

Example#

oxl✓ checked in CI
data Animal { name: str }
impl Animal {
  open fn speak() -> str => "..."
}

data Dog { embed Animal; breed: str }
impl Dog {
  fn speak() -> str => "Woof"      // <- missing-override
}
error
missing-override

How to fix#

oxl✓ checked in CI
data Animal { name: str }
impl Animal {
  open fn speak() -> str => "..."
}

data Dog { embed Animal; breed: str }
impl Dog {
  override fn speak() -> str => "Woof"
}

Add override, or rename the method if overriding was not intended.

See also#

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