/** * Member access: what `value.property` means. The receiver's kind selects the * rule — a class instance, a record, a collection, a string or number, an enum, * a namespace, a Promise — and the checked value methods a primitive publishes * are typed here beside the accesses that reach them. * * D114 R1b: this was `inferMember` (376 lines), `inferPrimitiveCall` and the * string/number member tables, spread through `Analyzer`. They are one cohesive * thing — the answer to "what does this receiver publish under this name" — so * they live in one collaborator the analyzer owns as `this.members`. What the * collaborator needs back from the analyzer is declared as `MemberAccessHost`: * that interface is the exact record of this cluster's dependency on the * analyzer, and nothing widens it silently. * * The analyzer's live walk state a member access reads — the class under * analysis, the `super` context, the static-initialization frame, the function * and constructor depths — arrives through getters, so the reads stay live * rather than freezing at construction. * * The retired-namespace migration (`retiredNamespaces`, `retiredNamespaceUses`) * is not here: its other half reads a *bare identifier*, in * `inferExpressionType`, so the rule is not member-only and both halves stay * where the one migration is assembled. */ import { type Expression } from "../ast.ts"; import { type ClassField, type ClassInfo, type CollectionOperation, type CollectionRuntimeKind, type PrimitiveOperation, type RuntimeNarrowingGuard } from "../contracts.ts"; import { type Diagnostic, type DiagnosticFix } from "../diagnostic.ts"; import { type Span } from "../source.ts"; import { type BinaryStorageKind, type ValueType } from "../types.ts"; import type { ConstantValue } from "./constant-values.ts"; import { type CollectionInference } from "./collections/inference.ts"; import { type PublishedMembers, type PublishedMembersHost } from "./published-members.ts"; export declare const stringPrimitiveOperations: Map; export declare const numberPrimitiveOperations: Map; export declare const discardedPurePrimitiveOperations: Set; /** * The lowering side tables one member access writes. `LoweringRecorder` * satisfies this; naming only what is written keeps its other tables out of * this cluster's dependency face. */ interface MemberLoweringFacts { readonly namedArgumentOrders: Map; readonly primitiveCalls: Map; readonly collectionCalls: Map; readonly collectionSizes: Map; readonly binaryCalls: Map; readonly binarySizes: Map; readonly stringSizes: Set; readonly optionalMembers: Set; readonly privateMembers: Set; readonly runtimeTypeObjectNames: Set; readonly classMethodReferences: Set; readonly errorCodeReads: Set; readonly instanceFieldReads: Set; readonly privateInstanceFieldReads: Set; readonly staticFieldReads: Map; readonly runtimeNarrowings: Map; } /** * Everything the member cluster asks of the analyzer that hosts it, and nothing * more. */ export interface MemberAccessHost extends PublishedMembersHost { constantValue(expression: Expression): ConstantValue | undefined; readonly asynchronousFunctions: boolean[]; boundaryValidationGuidance(expression: Expression | null, property: string | null): string; readonly callExpressionCallees: Set; checkArguments(arguments_: readonly Expression[], parameters: readonly ValueType[], callSpan: Span, requiredParameters?: number, rest?: ValueType, argumentNames?: readonly (string | null)[], parameterNames?: readonly string[]): boolean; readonly classes: Map; readonly collections: CollectionInference; conditionSubjectText(condition: Expression): string | null; readonly constructorDepth: number; declaresPrivateMember(className: string, name: string, staticMember: boolean): boolean; /** CO-I2: the guided-spelling channel, for the one report that is not a type error. */ readonly diagnostics: Diagnostic[]; findStaticField(className: string, name: string): ClassField | null; readonly functionDepth: number; getterAccessProperty(expression: Expression): string | null; inferredOrAnalyze(expression: Expression): ValueType; /** The binding a name resolves to; a member access reads only the type it holds. */ lookup(name: string): { readonly type: ValueType; } | null; lookupMemberNarrowing(path: string): ValueType | null; readonly lowering: MemberLoweringFacts; readonly memberAccessReceivers: Set; readonly privateGetters: Map>; readonly promiseInitializerBindings: WeakSet; /** * D114 F4: the one answer to "what does this receiver publish under this * name". The refusals and the lowering facts below are this cluster's, but * the answer they are decided from is shared with the semantic index, so the * editor cannot offer a member a read here would refuse. */ readonly published: PublishedMembers; recordSemanticExpression(expression: Expression, type: ValueType): void; recoveredTypeError(message: string, errorSpan: Span, fix?: DiagnosticFix): void; readonly semanticExpressionOwners: Map; semanticMembersOf(original: ValueType): ReadonlyMap; stableMemberAccessPath(expression: Expression): string | null; readonly staticFieldInitialization: { readonly className: string; readonly initialized: ReadonlySet; } | null; readonly superMemberContext: "instance" | "static" | null; readonly testExpectOperands: Map; typeError(message: string, errorSpan: Span, fix?: DiagnosticFix): void; /** * The one visible name close enough to be offered as a correction, or null. * The roster and the distance threshold are one decision the analyzer owns, * so a member report and a field report can never disagree about them. */ uniqueNearestName(requested: string, candidates: Iterable): string | null; } export declare class MemberAccess { private readonly host; /** The property each member access asks for, keyed by the receiver's span. */ readonly memberAccessProperties: Map; constructor(host: MemberAccessHost); inferPrimitiveCall(member: Extract, arguments_: readonly Expression[], argumentNames: readonly (string | null)[] | undefined, callSpan: Span): ValueType | null; inferMember(objectExpression: Expression, property: string, optional: boolean, memberSpan: Span, useNarrowing?: boolean, readValue?: boolean): ValueType; /** * `super.member`: the base declaration a derived member reads through, with * `super` bound at the reference site rather than through a receiver * temporary (D44 rule 74). */ private inferSuperMember; /** * What the receiver publishes under `property`, by the receiver's kind. The * families own disjoint kinds and are reached by the discriminant the one * `else if` chain tested in this order, so a receiver reaches the branch it * reached before. */ private receiverMember; /** The primitives and the collections: every receiver with a compiler-owned member roster. */ private primitiveMember; /** The structural receivers: a Promise, an action, a union, a record shape, an extension host type, a named record. */ private structuralMember; /** A class instance and a class constructor: fields, getters, methods and their visibility. */ private classMember; /** An enum object, a `type` object, a runtime `Type` — and the receiver that publishes nothing. */ private declaredValueMember; /** * The checked value methods a string and a number carry with them. The * contracts themselves are in `published-members.ts`, beside the roster the * editor offers, because the two are one fact; these two names stay here * because the analyzer hands them to the callable-member path by name. */ stringMember(property: string): ValueType | null; numberMember(property: string): ValueType | null; private collectionMemberError; /** * D38 §48: a retired collection member whose guidance names one successor * member is a mechanical rename of the member name itself. */ private collectionMemberFix; private nearestFieldFix; recordMemberAccessProperty(expression: Extract): void; } export {}; //# sourceMappingURL=members.d.ts.map