Skip to main content

Module wire_default

Module wire_default 

Source

Enums§

DefaultReason
#2607: why a field default has no wire (or in-memory) form. A default that reaches a name no type declares is kept apart, because in a generic record that name is a type parameter, and the checker says so rather than relaying the message.
DefaultValue
#2607 (Decision C): the in-memory value a record literal takes for a field it leaves out, as plain data — the twin of lower_field_default_wire, over the same closed set of static values, but in the shape a Bynk value has at runtime (a sum and Option/Result carry a variant tag, a Map/Set is a real collection) rather than its wire JSON.

Functions§

field_default_value
The DefaultValue of a field’s default init, given the field’s expected type and the visible types table. Err for anything not closed-form; the checker has already required every default to have one.
lower_event_field_default_wire
lower_field_default_wire for an event field or an old-state field, whose default may not apply a user generic anywhere in it (#2690 widened record fields only; the event codec and the migration read the default with no diagnostic path of their own).
lower_field_default_wire
Events slice 3a (#972): whether an event field’s default is closed-form, so that the JSON it deserialises from when its key is absent from the incoming JSON can be built. Type-directed — given the field’s expected TypeRef and the visible types table, every syntactic ambiguity (a bare Ident that is really a sum variant, a FieldAccess that is a qualified nullary variant) resolves the same way the checker resolves it, just narrower (a bare name must match a variant of this expected sum specifically) — so this needs no per-expression Ty map (expr_types), which a subscriber regenerating a publisher’s own event codec (emit_consumed_context_helpers) has no way to obtain anyway.
lower_field_default_wire_in
lower_field_default_wire for a field of a declaration whose type parameters are params (#2690): a default that needs a value of one of them is DefaultReason::UnresolvedType, even when a type of that name is declared.