Skip to content

feat: zero-fill spread#210

Merged
ivov merged 1 commit into
mainfrom
zerofill-spread
Apr 27, 2026
Merged

feat: zero-fill spread#210
ivov merged 1 commit into
mainfrom
zerofill-spread

Conversation

@ivov
Copy link
Copy Markdown
Owner

@ivov ivov commented Apr 27, 2026

Adds zero-fill spread syntax .. to fill unspecified struct fields with their zero value.

let cmd = cobra.Command {
  Use: "greet",
  Run: |_, args| { fmt.Println("hi") },
  ..
}

let p = Point { x: 10, .. }   // y: 0
let q = Point { .. }          // x: 0, y: 0

Zero-fill spread works for Lisette structs, Go-imported structs, and for enum struct variants.

  • For Go-imported types, .. always works.
  • For Lisette types, .. is allowed when every unspecified field has a defined zero (primitives, Slice, Map, Option, tuples, nested zero-fillable structs). Types without a zero (Ref<T>, Channel<T>, bare function types, Result<T, E>) must be provided explicitly.

@ivov ivov merged commit 9681887 into main Apr 27, 2026
7 of 9 checks passed
@ivov ivov mentioned this pull request Apr 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Released in lisette-v0.1.22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant