E1032: field missing from a struct literal

View source

A struct literal must give a value to every field that the struct declares.

A struct literal must give a value to every field that the struct declares. Actus has no default field values, so a missing field would be left uninitialized. The message names the field and the struct, and the error points at the literal.

Example

actus
struct Point {
    x: Int,
    y: Int,
}

verb main() {
    erg p: Point = Point { x: 1, };
}

Fix

Add the missing field.

actus
struct Point {
    x: Int,
    y: Int,
}

verb main() {
    erg p: Point = Point { x: 1, y: 2, };
}

Run actus explain E1032 in your terminal to read this entry offline. Browse Ownership & types or all error codes.