Lyricdev
GitHub

struct FieldInfo

pub struct FieldInfo :: [Equatable, Debug]

Conforms to Equatable, Debug.

Describes a field of a struct or a class, in declaration order.

In a comptime for over it, f.type names its type and e.[f] is the field. hasDefault is whether the declaration writes an initializer (the type's own default does not count, and a payload's field has none), so a loop tells an optional argument from a required one.

Fields

pub name: string
pub type: Type
pub index: int
pub visibility: Visibility
pub isVar: bool
pub hasDefault: bool