/** * The List operations: what one call of a compiler-owned List member answers, * and what it refuses. * * D115 §三: these were five private methods of `CollectionInference`, tried in * the order the one 721-line method evaluated its cases in. That order is * preserved by `inferListCall`, which is the whole of what leaves this file — * each family still answers `null` for a property it does not own, so a call * reaches exactly the case it reached before. */ import { type Expression } from "../../ast.ts"; import { type ValueType } from "../../types.ts"; import { type CollectionCall, type CollectionLoweringFacts } from "./call.ts"; import { type DiagnosticFix } from "../../diagnostic.ts"; import { type Span } from "../../source.ts"; /** What the List families ask of the analyzer that hosts them, and nothing more. */ export interface ListCallsHost { /** What the emitter will lower each collection call to. */ readonly lowering: CollectionLoweringFacts; expandAliases(type: ValueType): ValueType; inferExpression(expression: Expression, contextualType?: ValueType): ValueType; inferredExpressionType(expression: Expression): ValueType; /** `isAssignable` judged against the analyzer as the type environment. */ isAssignableHere(actual: ValueType, expected: ValueType): boolean; /** D42 item 65's single authority on whether a key carries a runtime order. */ orderedTypeCategory(source: ValueType): "number" | "string" | "comparable" | "dynamic" | null; readonlyDataViewOf(type: ValueType): ValueType; rejectCollidingKeyDomain(keySource: ValueType, span: Span, position: string): void; requireAssignable(actual: ValueType, expected: ValueType, valueSpan: Span): void; typeError(message: string, errorSpan: Span, fix?: DiagnosticFix): void; unorderedTypeGuidance(...types: readonly ValueType[]): string; } export declare class ListCalls { private readonly host; constructor(host: ListCallsHost); /** * The List operations, tried in the order the one method evaluated them in. * Each family answers null for a property it does not own; every property it * does own returns a type, so no family can be skipped by an answer of null. */ inferListCall(call: CollectionCall, object: Extract): ValueType | null; /** The callback transforms: `map`, `flatMap`, `filter` and `reduce`. */ private inferListTransformCall; /** The in-place writes, the whole-list copies, and the `==` probes over elements. */ private inferListMutationCall; /** `sorted`, whose comparator, `by=` selector and `descending=` flag are one rule set. */ private inferListSortedCall; /** The aggregates and the queries that answer about the List rather than rebuild it. */ private inferListQueryCall; /** D114 S3: the pipeline members that replaced the retired velar/collections functions. */ private inferListPipelineCall; private isNullExclusionPredicate; /** * D42 item 65: the key a selector answers. A literal arrow reports the * contextual key type rather than its own once the body checks out, so the * body's recorded type is the honest source for an inline arrow; a named * function answers with its declared result. */ private selectorKeyType; } //# sourceMappingURL=list.d.ts.map