Skip to main content

Module symbols

Module symbols 

Source

Structs§

ConsumedType
A type imported into a context via consumes. Carries enough metadata for the checker and emitter to enforce / express visibility.
FileDeclIndex
For each name declared in the unit (type, fn, method), record which source file declared it. Used by the emitter to render relative imports.
MessageBundleInfo
UnitTable
Combined symbol tables for a single logical commons or context.

Enums§

ContextMessageBundle
Locale capability track, slice 2 (#882): the message bundle a context’s Locale.current() negotiates against, auto-detected from the context’s direct uses (one level, not transitive — see combined_types_for just above, the precedent for this rule). None/One/Many drive three different behaviours: unchanged fixed-default Locale, real negotiation wiring, or (when the context also consumes Locale) bynk.messages.multiple_message_bundles — see check_locale_bundle_ambiguity (bynk-emit/src/project/validate.rs) and the per-Worker composition loop (bynk-emit/src/project.rs).

Functions§

assemble_index
v0.25 (ADR 0053): walk every parsed file’s top-level declarations into the def table (synthetic first-party units and test files excluded — neither declares user-editable symbols), then qualify and attach the recorded edges. Methods register as owners only (attribution), not as symbols — they are deferred along with fields and op names.
build_cross_context_info
Build the resolver::CrossContextInfo for a given consuming context. Used by both the resolver/checker (per-file processing) and the emitter (composition root + boundary casts).
build_file_decl_index
Tree-relative, deliberately. This is an emit structure, not an index: record_name_ref compares these paths against ctx.source_path (emitter.rs), which is the file’s include-root-relative path. Keying it by identity_path (ADR 0198) makes path != &ctx.source_path always true for a split project, so a name declared in the same file is emitted as a sibling import of itself — the module then cannot load, and a workers runtime test hangs rather than fails. See ADR 0201 (E).
build_unit_table
#696: each table-construction diagnostic is attributed to the project-relative identity_path of the file whose item produced it. Every error-producing loop below iterates for &i in indices, so it shadows a local errors vec and drains it into out, tagged with parsed[i].identity_path(), at the end of each file’s pass — leaving the many inner errors.push(…) sites untouched.
combined_types_for
Build the combined type table for unit: its own types merged with the types of every commons it uses. Used by cross-context resolution so we can resolve a consumed context’s service signatures against that context’s own view of types (v0.6 §4.5). v0.177 (#643): the callee’s own type namespace — its local declarations plus the commons types it uses.
consumes_span_of
#696: returns the parsed index of the owning file alongside the consumes clause span, so the caller can attribute the diagnostic to that file.
detect_context_message_bundle
Walks ctx’s own direct uses list for commons declaring a messages bundle with exactly one @reference block (a bundle missing or duplicating its own reference is already diagnosed by check_messages_bundles — this function simply doesn’t count it as “found”, rather than compounding an already-reported error).
parsed_alias_span
#696: returns the parsed index of the owning file alongside the alias span, so the caller can attribute the diagnostic to that file.
record_capability_clause_ref
v0.15: validate one given capability reference. A bare reference must name a capability declared in this context; a cross-context reference (given B.Cap) must name a capability the consumed context exports. Returns the local CapabilityInfo to add to the in-scope map for bare references; cross-context references return None (their calls are type-checked via consumed_capabilities at the call site) but are still validated here. v0.25: record a clause-position capability reference (provides Cap, bare given Cap), qualifying a flattened bare name to its providing unit. The span is the name segment only.
record_provides_clause_ref
v0.35 (ADR 0068): the Cap of a provides Cap = Provider clause — a capability reference and an implementation edge (the ambient owner is the provider). Flagged so assembly can tell it apart from the provider’s own given deps, which are capability refs owned by the same provider.
resolve_given_cap_ref
uses_span_of
#696: returns the parsed index of the owning file alongside the uses clause span, so the caller can attribute the diagnostic to that file.