Skip to main content

Module typed_ast

Module typed_ast 

Source

Structs§

CapturedVar
boxed: true — env stores (ref $box T), mutations go through box (let/param captures). boxed: false — env stores the value directly (const captures, copied at construction).
ExportEntry
A public export: maps a package-public mangled name onto the internal symbol it refers to. In single-file packages public_name == target.
FieldNarrowingCheck
A read guard for a field whose subclass declaration narrows the inherited one. The two declarations share one storage slot, so a write that goes through the parent’s — an inherited method, a parent-typed reference, the parent’s constructor — can leave the slot holding a value the subclass’s declaration does not admit. The language accepts the narrowing anyway (spec.md §Classes, matching TypeScript), so the read is what has to check.
GenericArgument
is_generic = the callee’s unsubstituted slot was a bare TypeVar; codegen emits cast::emit_box when set.
InstanceTypeContext
InstantiatedFieldGuard
InterfaceNarrowingTest
TypedAst
TypedCatchClause
ty is the binding’s class type — the root Error class for untyped catch (e), or the annotated Error subclass (which filters at runtime); boxed mirrors Let.boxed from the Capture pass.
TypedClassConstructor
TypedClassDecl
A typechecked class. Method/constructor bodies are checked in the class-body pass; codegen (SUB-480+) consumes the field layout, body IDs, and signatures.
TypedClassField
TypedClassMethod
TypedExpr
TypedFunction
TypedGlobal
TypedInterfaceDecl
TypedNumberEnumDecl
TypedNumberEnumMember
TypedObjectFieldOrigin
TypedObjectLiteralField
TypedParam
TypedStmt
TypedStringEnumDecl
TypedStringEnumMember
TypedSwitchCase
Multiple entries in values when consecutive case labels share a body. body is wrapped in NarrowRegion by the inferer for discriminated unions.
TypedTypeAliasDecl
ty is fully resolved; Type::TypeVar(name) placeholders correspond to generics entries.

Enums§

ClosureBody
EnumVariantPayload
Distinct from the top-level Number/String variants so the inferer can attach enum-identity diagnostics.
ExportKind
FieldNarrowingTest
What a redeclared field’s read guard verifies before it casts. The typechecker selects the most precise test codegen can lower, falling back to a read-time substituted test for erased class parameters.
ForOfKind
Resolved at typecheck time so desugar doesn’t re-run assignability. Iterable subsumes Map/Set and any structurally-iterable interface.
GlobalKind
Codegen treats both identically at the Wasm-global level; the inferer enforces the const write diagnostic.
InterfaceCarrier
Intrinsic
PostfixTarget
TypedArrayElement
TypedChainPart
optional drives short-circuit codegen; result_ty is the type after this part, without | null.
TypedClassAccessor
One accessor function. Getter and setter are independent: the read type (ret_ty) and write type (param.ty) need not match (TS 4.3+).
TypedExprKind
TypedInterfaceMember
TypedObjectFieldSource
TypedObjectMember
One member of an object literal, in source order.
TypedStmtKind
TypedSwitchValue
A case label. span anchors fallthrough and duplicate-case diagnostics.
TypedTypeDecl
Enums split by representation kind so the typed AST can’t represent a mixed-kind enum.
TypeofTagKind

Functions§

object_literal_layout
The structural type an object literal of type ty is built with. Its fields come from fields, which hold the undefined-filled optional fields and the declared field types a literal’s own type can leave out or narrow. A type with an index signature (from a spread) is already the layout.