OxL Reference

error generic-args

error Standard: [§4.8]

What it means#

The number or kind of generic arguments does not match the declaration (§4.8): a type or constant argument is missing or extra, or a type was given where a const parameter is expected. Generics are invariant and have no specialisation.

Example#

oxl✓ checked in CI
data Box<T> { value: T }

fn main() io {
  let b: Box<i32, i32> = Box{ value: 1 }      // <- generic-args (Box has one parameter)
  print("{b.value}")
}
error
generic-args

How to fix#

oxl✓ checked in CI
data Box<T> { value: T }

fn main() io {
  let b: Box<i32> = Box{ value: 1 }
  print("{b.value}")
}

Supply exactly the parameters the declaration lists, in order, using defaults only where the declaration provides them (V = bytes).

See also#

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