/** * `requireAssignable`: whether a value may stand where a contract is expected, * and the first-class generic bound check that runs with it. * * D115 §三: this was `requireAssignable` and the four methods that instantiate * a generic callable for it. The judgement itself is `isAssignable` in * `../../types.ts`; what lives here is the *reporting* — which of the guidance * sentences a refusal is finished with, and the bound violation reported once * per call site rather than once per read. */ import { type Diagnostic, type DiagnosticFix } from "../../diagnostic.ts"; import { type Span } from "../../source.ts"; import { type GenericBoundViolation, type ValueType } from "../../types.ts"; import { type MutableCellTarget } from "../scopes.ts"; /** What assignability asks of the analyzer that hosts it, and nothing more. */ export interface AssignabilityHost { asyncResultSpellingGuidance(actual: ValueType, expectedCore: ValueType): string | null; boundMethodRecordGuidance(actual: ValueType, expected: ValueType, valueSpan: Span): string | null; collectionBridgeGuidance(actual: ValueType, expectedCore: ValueType): string | null; contextuallyAssignable(actual: ValueType, expected: ValueType, valueSpan: Span): boolean; readonly diagnostics: Diagnostic[]; enumSingletonCellGuidance(actual: ValueType, expected: ValueType, target: MutableCellTarget | null): string | null; expandAliases(type: ValueType, seen?: ReadonlySet): ValueType; fieldsOf(identity: string): ReadonlyMap | null; instantiateGenericCallableHere(actual: Extract, expected: Extract, violations?: GenericBoundViolation[]): Extract; noteGenericApplications(type: ValueType, seen?: Set): void; readonlyProjectionGuidance(actual: ValueType, expected: ValueType, expandedExpected: ValueType, expectedCore: ValueType): string | null; readonly reportedBoundViolations: Set; typeError(message: string, errorSpan: Span, fix?: DiagnosticFix): void; } export declare class Assignability { private readonly host; constructor(host: AssignabilityHost); requireAssignable(actual: ValueType, expected: ValueType, valueSpan: Span, mutableCell?: MutableCellTarget | null): void; /** * D41 item 61 check site 2: a generic callable used as a value is solved and * erased silently, so the wrapper re-asks the bound question and turns the * rejection into a directed message at the value's own span. */ private instantiateCallable; private genericBoundViolation; concreteCallableFor(actual: ValueType, expected: ValueType, errorSpan?: Span): ValueType; /** One diagnostic per site, whichever of the two value paths reaches it first. */ private reportFirstClassBoundViolation; } //# sourceMappingURL=assignability.d.ts.map