Skip to content
Jiowcl edited this page Jul 11, 2026 · 2 revisions

Struct

struct Vec2
    x: number
    y: number
end

let v = Vec2 { x = 1, y = 2 }
  • Defines a global constructor function named Vec2.
  • Field types are checked when the constructor runs.
  • Use Name { … } or Name({ … }) to construct.

Clone this wiki locally