A struct literal must give every field a value; Auk has no implicit defaults. Copy the rest
from another value with ..base if that's what you mean.
Wrong#
struct P { x: int, y: int }
fn origin(): P = P { x: 0 }Fixed#
struct P { x: int, y: int }
fn origin(): P = P { x: 0, y: 0 }Common causes#
- A field added to the struct but not to every literal.
- Expecting fields to default to zero or empty.
- Updating one field: write
P { x: 1, ..p }.