E1021: invalid argument for a built-in intrinsic
Built-in intrinsics such as buffer_length, crc32 and copy check their arguments more strictly than ordinary verbs.
Built-in intrinsics such as buffer_length, crc32 and copy check their
arguments more strictly than ordinary verbs. The buffer must be a readable
Buffer, ranges and sizes must be integers, and copy accepts only a scalar
(Int, Bool, an integer or a float type; ADR-0059, ADR-0126) or a struct, an enum or a
pack declared meta copy, or an Array whose element type is itself a copy
type (ADR-0124). The message names the intrinsic and the parameter. The error points at the argument.
A console call names the kind of its value with a label: println(int: n),
println(string: s), println(bool: f) or println(buffer: b). println(x) and
eprintln(x) without a label are rejected with this error. The message names the
form to write, with the label of the type of x (ADR-0084), and the error points
at the whole call.
Example
Fix
Pass a value of the type that the parameter needs. actus fix writes the label of
an unlabelled println or eprintln call. A buffer cannot be
copied, so when a second owner is needed, move the first one. A struct, an
enum or a pack of plain data can declare meta copy to be copied.
Run actus explain E1021 in your terminal to read this entry offline. Browse Ownership & types or all error codes.