pub enum Ty {
}Expand description
A type in the checker’s universe (typed-mode-spec §2).
Variants§
Int
Float
Bool
String
Content
A first-class content value (issue #1846, docs/prose-dialect-spec.md
§3.5b’s capture contract): the type of a content-typed parameter,
e.g. fn radio(chan: string, text: content). Backed by the existing
fragment-capture path (BeginFragment…EndFragment →
Value::FragmentRef, brink_format::Opcode) — the same machinery an
ordinary call embedded in display position already composes through
(brink-codegen-inkb::content::emit_slot_expr). Deliberately a
distinct nominal leaf, not unified or coerced with Ty::String:
the whole reason content exists is that a captured prose run stays
translation-resident and measurable through the normal line path
(docs/decision-log.md 2026-07-31 ruling) — silently flattening it to
a plain string would defeat that. This variant is the type-resolution
prerequisite only; the dispatch mechanism that actually binds a
captured run to a content param (@[element(args = "…", block)]’s
block capture) is issue #1839’s scope, not this one’s.
Divert
A divert target value (-> knot used as a value, not a jump).
List(String)
A LIST value, nominal per the declaring LIST name (spec §2: “nominal
per LIST declaration”).
Array(Box<Ty>)
#[...] array sigil literal element type.
Map(Box<Ty>, Box<Ty>)
#{...} map sigil literal key/value types.
Struct(String)
A struct value, nominal per the declaring STRUCT name (TM-4b,
docs/typed-mode-spec.md §6 — mirrors List’s “nominal per LIST
declaration” precedent). Carries only the shape name in this slice —
no field-type table is threaded through inference yet (TM-4c/codegen
concern); a struct-typed slot is still concrete for E065/E066
escape-checking purposes (brink-analyzer::strict::classify).
Fn(Vec<Ty>, Box<Ty>, FnRow)
A function value’s type, fn(T…): R (T1c, docs/t1c-spec.md §4;
typed-mode-spec §3 reserved the written form). The param row is
val-only by construction: every ref param of the target is
bound away at #fn creation (all refs must bind in the prefix,
E080), so the type form carries no modes — a Ty::Fn row describes
exactly the remaining (unbound) params a call through the value
must supply.
The third component is the effect row riding the type
(docs/effects-spec.md §5, issue #1680 step 3) — see FnRow.
It is joined by unify alongside the params and the return, and
is deliberately not part of assignability: see assignable.
Handle(String)
A host-resource handle value, nominal per its manifest-declared kind
name (T1d-2, docs/t1d-spec.md §3: Handle<K> — mirrors List’s
“nominal per LIST declaration” precedent, but the vocabulary lives in
the external manifest, not ink source). Two handle types unify only
when the kind names match exactly; a cross-kind pair is a genuine
structural mismatch and joins to Conflicted (#627 lattice) — a
binding declared Handle<AudioInstance> and one declared
Handle<Timer> are as incompatible as int and string.
Option(Box<Ty>)
Option<T> — the third compiler-known parameterized builtin
(NS-A1, docs/stdlib-spec.md §1.4, ruled 2026-07-18), joining
Array/Map in the static type language. A compiler-owned enum
shape (none / some(T)), NOT user generics (#1090’s door stays
shut). Unifies pointwise on the element like Array; against any
non-Option concrete type it is a genuine structural mismatch —
the ruled Option<T> ≠ T strictness IS the Conflicted join
(display-boundary forgiveness is Track B4 and deliberately absent
from this lattice).
Range
An integer range value (NS-A5, docs/stdlib-spec.md §7 — F7 ruled
2026-07-19: ranges are a real Value kind). The non_empty flag is
the language’s first value refinement: true is checker-minted
EVIDENCE that the range denotes at least one element — a refined
view over the same runtime value, never a second value kind. The
checker mints it in exactly two places (the closed-refinement
doctrine): a range literal with provably-inhabited bounds, and the
some payload of non_empty(r). Under gradual typing the flag is
inert (F8 — the runtime fault is the residual); under types = strict rand::int demands it (E117).
Fields
Weighted(Box<Ty>)
Not (yet) resolved to a concrete type — legal in this slice (spec
Weighted<T> — the weighted table builtin (NS-A7,
docs/stdlib-spec.md §8): compiler-known and parameterized like
Option/Array, NOT user generics. Unifies pointwise on the value
element; against any other concrete type it is a genuine structural
mismatch (Conflicted). v1 is construct-and-roll — the only
producer is the weighted(…) intrinsic, the only consumer roll.
Tower(TowerTy)
A numeric-tower value kind (NS-A8, docs/tower-mini-spec.md):
vec2/vec3/vec4/quat/mat2/mat3/mat4 — seven closed
compiler-known kinds carried by one variant (they behave identically
in the lattice: nominal scalar-like leaves; no coercion into or out
of them, so a tower-vs-anything-else join is Conflicted).
Unknown
§2: “unresolved -> Unknown, which is LEGAL”). Acts as the join
identity: unify(Unknown, x) == x.
Conflicted
A genuine, irreconcilable type conflict was observed for this slot
(e.g. used as both int and string) — #627 ruling. A distinct
absorbing lattice point, not a synonym for Unknown:
unify(Conflicted, x) == Conflicted for every x (including
Unknown), so a conflict can never silently “heal” back to a
concrete type depending on the order observations arrive in. Gradual
mode (every consumer today) treats it exactly like Unknown —
strict mode’s TM-3 (#619) is the slice that reports it as a
diagnostic; this lattice point only exists so that reporting can be
order-independent when it lands.
Implementations§
Source§impl Ty
impl Ty
Sourcepub fn display(&self) -> String
pub fn display(&self) -> String
Human-readable name, for future hover/diagnostic surfacing (TM-5).
pub fn is_unknown(&self) -> bool
pub fn is_conflicted(&self) -> bool
Sourcepub fn is_unresolved(&self) -> bool
pub fn is_unresolved(&self) -> bool
Gradual/advisory consumers’ view (#627 ruling: “Conflicted like
Unknown, zero behavior change today”) — a slot that is either
unconstrained or genuinely conflicted carries no usable concrete
type for a consumer that isn’t strict-mode’s TM-3 conflict reporter.
Strict mode (#619) is the one place these two must stay
distinguished; every other consumer should read this instead of
is_unknown().
pub fn is_numeric(&self) -> bool
Trait Implementations§
Source§impl Default for Ty
Unknown is the natural default: every local/return slot starts here
before any use narrows it (see the module doc on why join-from-Unknown
stands in for a union-find unifier in this monomorphic, overload-free
universe).
impl Default for Ty
Unknown is the natural default: every local/return slot starts here
before any use narrows it (see the module doc on why join-from-Unknown
stands in for a union-find unifier in this monomorphic, overload-free
universe).
impl Eq for Ty
Source§impl From<InferredType> for Ty
impl From<InferredType> for Ty
Source§fn from(t: InferredType) -> Self
fn from(t: InferredType) -> Self
Source§impl Ord for Ty
impl Ord for Ty
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Ty
A stable ordering over Ty values, used only to keep generated
diagnostics/tests deterministic (never for typing decisions). Not derived
Ord because Ty intentionally has no natural total order over its
structural variants beyond “same shape, compare recursively”.
impl PartialOrd for Ty
A stable ordering over Ty values, used only to keep generated
diagnostics/tests deterministic (never for typing decisions). Not derived
Ord because Ty intentionally has no natural total order over its
structural variants beyond “same shape, compare recursively”.
impl StructuralPartialEq for Ty
Auto Trait Implementations§
impl Freeze for Ty
impl RefUnwindSafe for Ty
impl Send for Ty
impl Sync for Ty
impl Unpin for Ty
impl UnsafeUnpin for Ty
impl UnwindSafe for Ty
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.