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

error generic-args

error Стандарт: [§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✓ проверяется в 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✓ проверяется в 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 · Версия документации 1.0.0-beta© OxwaldLink · сгенерировано из Стандарта, исходников std и руководства