/** * The collection half of inference: what a List, Map, Set or Record publishes * as its members, what one call of a member means, and the migration off the * `velar/collections` module those members replaced. * * D114 R1b: this was `inferCollectionCall` (721 lines), the four member * resolvers, the operation rosters and the retirement machinery, spread through * `Analyzer`. They are one cohesive thing — the compiler-owned collection * vocabulary and its checking — so they live in one collaborator the analyzer * owns as `this.collections`. What the collaborator needs back from the * analyzer is declared as `CollectionInferenceHost` (`./call.ts`): that * interface is the exact record of this cluster's dependency on the analyzer, * and nothing widens it silently. * * `inferCollectionCall` is a prologue and four per-kind dispatchers, and the * List dispatcher is five operation families. The order the original evaluated * its cases in is the order they are tried in, and each family answers `null` * for a property it does not own, so a call reaches exactly the case it reached * before. Everything the families share — the resolved arguments, the read-only * views of the receiver's element/key/value, and the argument helpers — is one * per-call `CollectionCall` object built once by the prologue. * * D115 §三: this file is the facade of the directory. The families themselves * live in `./list.ts`, `./map.ts`, `./set.ts` and `./record.ts`, the member * resolvers in `./members.ts`, the rosters in `./operations.ts`, and the * retirement in `./retired.ts`; each declares the narrow host it needs. The * four member resolvers keep their place in this class's surface because the * analyzer, member access and the surface-version gate all call them by name. */ import { type Expression } from "../../ast.ts"; import { type Span } from "../../source.ts"; import { type ValueType } from "../../types.ts"; import { type CollectionInferenceHost } from "./call.ts"; import { RetiredCollectionMigration } from "./retired.ts"; export declare class CollectionInference { private readonly host; /** The migration off `velar/collections`, whose members this cluster owns. */ readonly retired: RetiredCollectionMigration; /** The five files this facade dispatches to, each holding the same host. */ private readonly members; private readonly listCalls; private readonly mapCalls; private readonly setCalls; private readonly recordCalls; constructor(host: CollectionInferenceHost); /** * One call of a compiler-owned collection member. The prologue resolves the * receiver, refuses a mutation through a read-only view, publishes the * member's contract and settles the arguments; the receiver's kind then * selects the family that types the operation. Every step runs in the order * it ran when this was one method, because each one writes diagnostics or * lowering the next may read. */ inferCollectionCall(member: Extract, sourceArguments: readonly Expression[], argumentNames: readonly (string | null)[] | undefined, callSpan: Span): ValueType | null; /** The read-only and comparison views of the receiver's element, key and value. */ private receiverViews; /** * The arguments the operation families see. A named-argument call is planned * against the member's published parameter names and every argument is * inferred here, before any family runs; a positional call is passed through * untouched. A plan that did not resolve answers the whole call. */ private resolveArguments; /** * What a List publishes under `property`, or null when it publishes nothing * under that name — and the same question for a Map, a Set and a Record. * They stay on this class's surface because member access, completion and * the surface-version gate reach them through `analyzer.collections`. */ listMember(list: Extract, property: string): ValueType | null; mapMember(map: Extract, property: string): ValueType | null; recordMember(record: Extract, property: string): ValueType | null; setMember(set: Extract, property: string): ValueType | null; } //# sourceMappingURL=inference.d.ts.map