OxL Reference

error interface-not-satisfied

error Standard: [§4.6]

What it means#

Interfaces are structural (§4.6): a type satisfies I if for each method of I without a default it has a method with the same name, a compatible receiver, the same parameter types, the same or narrower return type, and effects contained in those of the interface. The code is reported where such a satisfaction is required: assert T: I, a generic bound used with a concrete type, or a dyn I conversion.

Example#

oxl✓ checked in CI
interface Shape { fn area() -> f64 }

data Blob { id: u64 }

assert Blob: Shape      // <- interface-not-satisfied
error
interface-not-satisfied

How to fix#

oxl✓ checked in CI
interface Shape { fn area() -> f64 }

data Blob { id: u64 }

impl Blob {
  fn area() -> f64 => 0.0
}

assert Blob: Shape

Add the missing method with a matching signature, or relax the interface by giving the method a default body. See also bound-not-satisfied for generic bounds.

See also#

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