/** * The argument list of one call: how many values a callable accepts, what each * position expects, and what a call spread or a named argument is allowed to * stand for. * * D114 R1f: every caller of this check is in this directory — an ordinary call, * an intrinsic and a collection member all check their arguments the same way — * so it moves out of `analyzer.ts` to sit beside them. `named-arguments.ts` * still owns the *plan* (which source position fills which parameter slot); * this module owns what the plan is then checked against. */ import { type Expression } from "../../ast.ts"; import { type DiagnosticFix } from "../../diagnostic.ts"; import { type Span } from "../../source.ts"; import { type ValueType } from "../../types.ts"; import { type NamedArgumentPlan } from "./named-arguments.ts"; import { type MutableCellTarget } from "../scopes.ts"; /** What the argument check asks of the analyzer that hosts it, and nothing more. */ export interface CallArgumentsHost { inferExpression(expression: Expression, contextualType?: ValueType): ValueType; iterationGuidance(type: ValueType): string; iterationSource(expression: Expression, type: ValueType): ValueType; planNamedArguments(arguments_: readonly Expression[], argumentNames: readonly (string | null)[] | undefined, parameters: readonly ValueType[], parameterNames: readonly string[] | undefined, requiredParameters: number, callSpan: Span, rest?: ValueType): NamedArgumentPlan | null; requireAssignable(actual: ValueType, expected: ValueType, valueSpan: Span, mutableCell?: MutableCellTarget | null): void; typeError(message: string, errorSpan: Span, fix?: DiagnosticFix): void; } export declare class CallArguments { private readonly host; constructor(host: CallArgumentsHost); checkArguments(arguments_: readonly Expression[], parameters: readonly ValueType[], callSpan: Span, requiredParameters?: number, rest?: ValueType, argumentNames?: readonly (string | null)[], parameterNames?: readonly string[]): boolean; orderNamedArguments(arguments_: readonly Expression[], argumentNames: readonly (string | null)[] | undefined, parameters: readonly ValueType[], parameterNames: readonly string[] | undefined, requiredParameters: number, callSpan: Span, rest?: ValueType): readonly Expression[] | null; } //# sourceMappingURL=arguments.d.ts.map