error generic-args
Неверные аргументы дженерика.
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#
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#
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).