import { type EmptyCollectionTarget } from "./analysis/expressions/contextual.ts"; import { type ConstantValue } from "./analysis/constant-values.ts"; import { type AnalyzableFunctionDeclaration } from "./analysis/functions.ts"; import { type Binding, type BuiltinTypeNamePosition, type MutableCellTarget } from "./analysis/scopes.ts"; import type { Expression, FunctionDeclaration, Program, Statement, TypeReference, TypeSyntax } from "./ast.ts"; import { type AnalysisContext, type ClassInfo, type CompilerAnalysisExtension, type InitializationImportRead, type LoweringHints } from "./contracts.ts"; import { type PermanentNamespaceName } from "./core-vocabulary.ts"; import { type Advisory, type Diagnostic, type DiagnosticFix } from "./diagnostic.ts"; import { type Span } from "./source.ts"; import { type ExtensionValueType, type GenericTypeInfo, type TypeEnvironment, type TypeParameterBound, type ValueType } from "./types.ts"; export { disposeMemberKey, iterateAsyncMemberKey, iterateMemberKey, } from "./contracts.ts"; export type { AnalysisContext, ClassField, ClassInfo, CollectionOperation, CollectionRuntimeKind, DisposalContract, FormReadField, InitializationImportRead, LoweringHints, PrimitiveOperation, RecordFromHint, RecordMapFromHint, RecordTypeField, RuntimeNarrowingGuard, } from "./contracts.ts"; export { mutatingCollectionMethods } from "./analysis/collections/operations.ts"; export { MATH_NAMESPACE_MEMBERS, permanentNamespaceCoveringModule, TEXT_NAMESPACE_MEMBERS } from "./analysis/vocabulary.ts"; export { inferredResultPlaceholderType } from "./analysis/functions.ts"; export declare function isCorePrimitiveName(name: string): boolean; export declare class Analyzer implements TypeEnvironment { protected readonly diagnostics: Diagnostic[]; protected readonly advisories: Advisory[]; private readonly advisedIdentities; private readonly namedTypes; private readonly namedTypeReadonlyFields; private readonly namedTypeIdentities; /** Direct record bases by local name or canonical identity. Field tables remain flattened separately. */ private readonly namedTypeBases; /** Fields contributed by a base, used to reject redeclaration in the child body. */ private readonly inheritedTypeFields; /** D55: generic record declarations in scope, by the name this module writes. */ private readonly genericTypes; /** The same declarations by identity, so a substituted application can be re-instantiated. */ private readonly genericTypesByIdentity; /** Every instantiation seen, by identity, waiting for its field table to be asked for. */ private readonly genericApplications; /** One canonical object per instantiation, so identity-keyed cycle guards still cut. */ private readonly canonicalGenericApplications; private readonly typeAliases; private readonly invalidDeclaredTypes; private readonly typeReferenceValidity; private readonly typeParameterFrames; private readonly typeParameterFrameBounds; private readonly invalidExternTypeReferences; private readonly enums; private readonly classes; /** * D55 rule 120 layer two: every class instantiation seen, by identity, * waiting for its member table to be asked for. It is the class-side twin of * `genericApplications` and is read only through `classInfo`, so no lookup * can find a generic class's members unsubstituted. */ private readonly classApplications; /** Built instantiations, by identity. Kept apart from `this.classes` so no declaration roster ever sees one. */ private readonly classInstantiations; /** The declarations behind the class entries, for the type parameters a member is checked under. */ private readonly classDeclarations; /** Whether `registerClassShapes` has run, so an instantiation built before it is never cached. */ private classShapesRegistered; /** * The `is`/`case` type syntaxes a bare generic class name may stand in. The * runtime check is `instanceof`, which knows nothing about type arguments, so * `is Stack` is the whole of what can be asked there — while a type position * still refuses the bare name for having no arity (D55 rule 126). */ private readonly bareGenericClassPositions; /** Calls whose written `<...>` VEL2031 already reported, so no second report names the same mistake. */ private readonly typeArgumentsRemovedCalls; /** * While a static member of a generic class is being read: the class's type * parameter names. A static member belongs to the class, not to an * instantiation, so naming one there is refused where it is written. */ private staticMemberTypeParameters; private readonly classDisplayNames; private readonly externModules; private readonly externTypeImports; private readonly externClassDeclarations; private readonly returnContexts; private readonly asynchronousFunctions; /** * D114 R1a: the side tables the analyzer records for the emitter — what each * span lowers to. They are the analyzer's half of `LoweringHints`, so they * live together in one collaborator rather than among the analyzer's own * inference state. The three `protected` tables the Web analyzer writes * (`enumValueBindings`, `extensionLiterals`, `extensionCalls`) stay fields of * this class: they are part of the subclass seam. */ private readonly lowering; /** * D114 R1a: the A roster — every `advise*` proof — lives in one collaborator. * It reaches this analyzer only through the `AdvisoryHost` interface built in * the constructor, which is the exact list of what the proofs depend on. */ private readonly advisoryRoster; /** * D114 R1b: the compiler-owned collection vocabulary — what a List, Map, Set * or Record publishes, what one call of a member means, and the migration off * the `velar/collections` module those members replaced. It reaches this * analyzer only through the `CollectionInferenceHost` interface built in the * constructor, which is the exact list of what the cluster depends on. */ private readonly boundaries; private readonly collections; /** * D114 R1b: everything that happens between a call's parentheses — the * callee's kind, the generic solver, the standard-module intrinsics and the * named-argument plan. It reaches this analyzer only through the * `CallInferenceHost` interface built in the constructor. */ private readonly callArguments; private readonly calls; /** * D114 R1b: what a receiver publishes under a name — every member access, and * the checked value methods a string or a number carries. It reaches this * analyzer only through the `MemberAccessHost` interface built in the * constructor. */ private readonly members; /** * D114 F4: what a receiver publishes, asked by the checker one name at a time * and by the editor a whole roster at a time. One collaborator answers both, * so a member `members` accepts is a member `semanticIndex` offers. */ private readonly published; /** * D114 R1d: the flow cluster. `flowFacts` is the store — what every binding * and member path is believed to hold, and the snapshots one moment is * compared against another with; `narrowing` is what a check proves and what * a write retracts; `loops` is the back-edge pass; `flowMerge` is what a * construct's arms agree on. All four are built over one shared host object, * because the four halves call each other as much as they call the analyzer. */ /** * D114 R1d: the declaration cluster — what a `type`, alias, `enum` or * generic template name means, and whether a written type reference is * legal. The tables these read (`namedTypes`, `typeAliases`, `enums`, * `genericTypes`) stay fields of this class, because the member, call and * class clusters read them too; they arrive through the shared host. */ /** * D114 R1d: the class cluster — the shape a class name stands for, its * members, what it inherits, and the `@dispose` / `@iterate` roles it may * declare. The tables stay fields of this class; the collaborators read * them through the shared class host. */ /** * D114 R1d: the module cluster — what a module brings in, what it * publishes, and which reads run while the module itself evaluates. */ /** * D114 R1d: the scope stack — the chain a lookup walks, the roster behind * "did you mean", and the rules a declaration passes to enter a scope. */ /** * D114 R1d: `match` — the arms, the pattern walk, the coverage ledger and * the exhaustiveness report. */ private readonly matching; private readonly matchCoverage; private readonly scopeStack; private readonly moduleImports; private readonly moduleExports; private readonly moduleInitialization; private readonly classRegistry; private readonly classMembers; private readonly classInheritance; private readonly classRoles; private readonly typeRecords; private readonly aliases; private readonly enumDeclarations; private readonly generics; private readonly typeReferences; private readonly flowFacts; private readonly narrowing; private readonly locations; private readonly loops; private readonly flowMerge; private readonly reportedBoundViolations; /** D51 rule 101: arrows that read a `using`-owned binding, by arrow span. */ private readonly arrowOwnedCaptures; private readonly arrowCaptureFrames; private readonly declaredTestTitles; private readonly javaScriptBindings; private readonly constructorFieldInitializations; private readonly nonFallthroughWhileStatements; private readonly matchesWithRefusedArm; private readonly reportedPromiseResolutionHazards; private readonly callExpressionCallees; private readonly memberAccessReceivers; protected readonly reactiveBindings: Map; protected readonly enumValueBindings: Map; protected readonly extensionLiterals: Map; protected readonly extensionCalls: Map; private readonly semanticBindingTypes; private readonly semanticBindingMembers; private readonly semanticMemberCache; private readonly semanticExpressionTypes; private readonly semanticExpressionMembers; private readonly semanticExpressionOwners; private readonly semanticObjectPropertyOwners; private readonly semanticBindingEntryOwners; protected readonly semanticJsxAttributeOwners: Map; private readonly semanticExpressionContexts; private readonly semanticExpressionContextMembers; private readonly contextualAssignments; private readonly inferredExpressionTypes; private readonly inferredFunctionResultSeeds; private readonly inferredFunctionResultTypes; private readonly finalizeFunctionResultInference; /** * D85 rule 209: one mistake is reported once. A reported VEL4039 hands its * position `invalidType`, and an invalid body-inferred result is otherwise a * convergence failure — so the four collections below carry the *reported* * hole forward, and only that hole, to the place VEL4025 is decided. * `reportedCollectionHoles` are the names bound to one, `reportedResultHoles` * the local function results that are one, `functionResultKeys` maps a * callable name to the result a call to it reaches, and * `deferredConvergenceReports` holds the reports whose answer needs a callee * that may be declared further down the module. */ private readonly reportedCollectionHoles; private readonly bindingHoleCauses; private readonly reportedResultHoles; private readonly functionResultKeys; private readonly deferredConvergenceReports; private readonly privateFields; private readonly privateGetters; private readonly privateMethods; private readonly privateStaticFields; private readonly privateStaticGetters; private readonly privateStaticMethods; private readonly predeclared; private functionDepth; private parameterDefaultDepth; private loopDepth; private finallyLoopDepths; private unreachableDiagnosticDepth; private loopCaptureFloor; private currentClass; private superMemberContext; private classFieldInitializerDepth; private instanceFieldInitializerDepth; protected deferredExecutionDepth: number; private readonly importedBindingSources; private readonly importedValueAliases; private readonly importedBindingOrigins; /** Namespace import locals by name, known before signature validation runs (ENM-I9 teaching). */ private readonly namespaceImportLocals; private readonly initializationImportReadSites; /** * D31 item 23's recorded residual: a top-level call of a module-local * function runs that body during module evaluation, so a read of an imported * binding inside it is an initialization-position read reached through one * hop. The stack is the function frame a deferred read belongs to; the map * is that frame by the name it was bound to, so a call resolves to it after * the whole module is analyzed and hoisting order stops mattering. */ private readonly deferredReadFrames; private readonly localFunctionFrames; private readonly arrowDeferredFrames; private readonly initializationLocalCalls; /** Local class bindings mapped to the source offset where their `class` statement evaluates (CLS-D8). */ private readonly hoistedClassDeclarations; /** * D90 R12: public class members whose omitted annotation inferred an output * `any`. Whether the member is at an export position depends on whether a * consumer can reach its class, which is not settled until the whole module * is analyzed, so the report waits for reportExportPositionAny. */ private readonly exportPositionCandidates; private staticFieldInitialization; protected constructorDepth: number; private allowedSuperCall; protected flowFrameDepth: number; private readonly primitiveNames; private readonly primitiveParents; private readonly primitiveMutableFields; private readonly extensionGlobals; private readonly extensionReservedBindings; private readonly globalGuidance; private readonly scopedGlobalGuidance; private readonly analysisExtensions; private readonly sourceText; private readonly executeMain; private readonly retiredNamespaces; /** Every `Retired.member` read, collected so one migration can carry the whole rewrite. */ private readonly retiredNamespaceUses; private readonly promiseInitializerBindings; private readonly constants; private readonly promiseInspectionAliases; private readonly testExpectOperands; /** * D114 F2: the migration off the import spellings a permanent namespace * replaced — the reads it has to rewrite, and the reports it earns. Its own * module under D115 §三; it reaches this analyzer only through the two names * `PermanentNamespaceImportHost` declares. */ private readonly namespaceImports; /** * D115 §三: the expression cluster. Twelve collaborators own what an * expression means — the literals, the operators, the binary rules, the * equality and ordering domains, contextual typing, assignability, the * guidance a refusal ends with, an identifier read, the text conversion, the * record projections, an assignment, and the semantic index the editor reads. * All twelve reach this analyzer through one object, `expressionHost()`, * whose members are the union of the narrow faces each of them declares. */ private readonly assignability; private readonly assignment; private readonly binary; private readonly contextual; private readonly equality; private readonly guidance; private readonly identifiers; private readonly literals; private readonly operators; private readonly projections; private readonly semanticIndex; private readonly text; /** * D115 §三 / D114 R1f: the statement cluster. Each collaborator owns one * family of statement heads, and all of them read this analyzer through the * single `statementHost()` object whose type is the union of the narrow faces * they declare. */ private readonly asyncResults; private readonly controlStatements; private readonly declarationStatements; private readonly externStatements; private readonly functionStatements; private readonly loopStatements; constructor(context?: AnalysisContext, extensions?: readonly CompilerAnalysisExtension[]); /** * The error classes the language itself raises, registered before any source * is read so `catch`, `is` and construction all see them. * * D114 item 11: the table itself is `analysis/builtin-errors.ts`, because the * Core surface digest hashes it and a table two readers share is a module. */ private registerBuiltinErrorClasses; /** D114 R1a: what the A roster is allowed to ask of this analyzer. */ private advisoryHost; /** D114 R1b: what the collection cluster is allowed to ask of this analyzer. */ private collectionHost; /** D114 R1b: what the call cluster is allowed to ask of this analyzer. */ private callHost; /** D114 R1b: what the member cluster is allowed to ask of this analyzer. */ /** The one object the match cluster is handed; every entry is a live read. */ private matchHost; /** The one object the scope stack is handed; every entry is a live read. */ private scopeHost; /** * The one object the three module collaborators are handed. */ private moduleHost; /** * The one object the four class collaborators are handed. Every entry is a * live read of the analyzer: the walk depths, the class under analysis and * the `super` context all move while a class body is analyzed. */ private classHost; /** * The one object the five declaration collaborators are handed. Every entry * is a live read: the tables fill while the module is being analyzed. */ private declarationHost; /** * The one object the four flow collaborators are handed. Every property is a * live read of the analyzer or of another flow collaborator: the scope stack * grows and shrinks, the flow frame depth moves, and the member-fact stack is * rewritten while a condition is being analyzed, so none of it can be a value * captured when the collaborators were built. */ private flowHost; /** * D115 §三: what the expression cluster is allowed to ask of this analyzer. * One object satisfies all twelve narrow faces, and this declaration is where * that is checked. The walk state a rule reads mid-flight — the class under * analysis, the function and initializer depths, the annotation-free head — * is declared here rather than in either half below, because a getter is only * live while it stays a getter: spreading one evaluates it once and freezes * the read. The two halves have no name of their own; their type is the * object each returns. */ private expressionHost; /** Everything the expression cluster asks this analyzer to answer. */ private expressionQueryHost; /** Everything it tells this analyzer: a diagnostic, an advisory, a lowering fact, a flow fact. */ private expressionReportHost; protected requireAssignable(actual: ValueType, expected: ValueType, valueSpan: Span, mutableCell?: MutableCellTarget | null): void; protected inAnnotationFreeHead(): boolean; protected requireSettledCollectionElement(initializer: Expression, declared: ValueType, annotated: boolean, target?: EmptyCollectionTarget | null): boolean; protected semanticMembersOf(original: ValueType): ReadonlyMap; /** * The one object the member cluster is handed — and, since `MemberAccessHost` * extends `PublishedMembersHost`, the one the published-member resolver reads * too: the same tables, plus the reports only `MemberAccess` writes. */ private memberHost; /** * D113: the surface-version gate reads the same member resolvers that type * checking uses. Placeholder types retain every parameter/result position, * and mutable plus read-only receivers expose the presence boundary too. */ /** D114 R1f: what the argument check is allowed to ask of this analyzer. */ private callArgumentsHost; /** D114 R1f: what the JSON and form boundary questions are allowed to ask of this analyzer. */ private boundaryVocabularyHost; /** * Everything the statement cluster asks this analyzer to *do*. Every member * here is a plain method, so this half can be spread into the object below * without freezing anything; the walk state it must read live is declared * there instead. */ private statementActionHost; /** * D115 §三 / D114 R1f: the one object the six statement collaborators are * handed. The walk state a statement moves — the loop depth, the pending * scope declarations, the loop contexts a back edge reads — is a live * accessor rather than a captured value, because a statement body is * analyzed while all three are being written. */ private statementHost; static coreCollectionMemberContracts(): ReadonlyMap; private readonly modulePath; private readonly importBindings; private readonly dynamicImports; analyze(program: Program): readonly Diagnostic[]; /** * D89: the advisories this analysis raised. `analyze` keeps returning the * diagnostics alone, so the caller reads the two channels separately and the * cursor arithmetic over `this.diagnostics` stays exact. */ analyzedAdvisories(): readonly Advisory[]; private predeclareTopLevel; loweringHints(): LoweringHints; semanticTypes(): ReadonlyMap; inferredFunctionResults(): ReadonlyMap; static inferredFunctionResultsMatch(left: ReadonlyMap, right: ReadonlyMap): boolean; semanticMembers(): ReadonlyMap>; analyzedClasses(): ReadonlyMap; analyzedNamedTypes(): ReadonlyMap>; analyzedNamedTypeReadonlyFields(): ReadonlyMap>; analyzedNamedTypeBases(): ReadonlyMap; analyzedGenericTypes(): ReadonlyMap; semanticExpressions(): { readonly types: ReadonlyMap; readonly members: ReadonlyMap>; readonly owners: ReadonlyMap; readonly objectPropertyOwners: ReadonlyMap; readonly bindingEntryOwners: ReadonlyMap; readonly jsxAttributeOwners: ReadonlyMap; readonly contexts: ReadonlyMap; readonly contextMembers: ReadonlyMap>; }; fieldsOf(identity: string): ReadonlyMap | null; /** The generic record a name in this module refers to, local or imported. */ protected expandAliases(type: ValueType, seen?: ReadonlySet): ValueType; expandTypeAliases(type: ValueType): ValueType; protected validateTypeReference(reference: TypeReference, resolve?: (reference: TypeReference) => ValueType): boolean; enumWireValuesOf(identity: string, name: string): ReadonlyMap | null; enumValuesOf(identity: string): readonly (string | number)[] | null; protected genericTypeInfo(name: string): GenericTypeInfo | null; isExtensionTypeAssignable(actual: ExtensionValueType, expected: ExtensionValueType, assign: (actual: ValueType, expected: ValueType) => boolean): boolean | undefined; extensionTextForm(type: ValueType): boolean | undefined; protected readonlyDataViewOf(type: ValueType): ValueType; readonlyFieldsOf(identity: string): ReadonlySet | null; protected predeclareExtensionStatement(_statement: Statement): boolean; protected analyzeExtensionStatement(_statement: Statement): boolean; protected extensionExpressionContainsDirectAwait(expression: Expression, contains: (expression: Expression) => boolean): boolean | undefined; protected extensionStatementContainsDirectAwait(statement: Statement, containsExpression: (expression: Expression) => boolean, containsBlock: (statements: readonly Statement[]) => boolean): boolean | undefined; protected prescanExtensionScopeDeclaration(_statement: Statement): { readonly name: string; readonly span: Span; } | null; protected inferExtensionExpression(_expression: Expression, _contextualType: ValueType): ValueType | undefined; protected inferExtensionCall(_callee: ExtensionValueType, _arguments: readonly Expression[], _argumentNames: readonly (string | null)[] | undefined, _callSpan: Span): ValueType | undefined; protected validateExtensionTypeSyntax(_syntax: TypeSyntax, _validate: (syntax: TypeSyntax) => boolean, _resolve: (reference: TypeReference) => ValueType): boolean | undefined; protected extensionFieldsOf(_name: string): ReadonlyMap | null; /** Whether an extension owns the body a `return` outside any function stands in, and with it that body's `return` rules: Core has no such body, so VEL3003 is the whole answer here, while the Web extension's component answers for itself rather than being made to contradict its own rule (D114 0.29.0 JX-I2). */ protected extensionOwnsFunctionlessReturn(): boolean; protected invalidExtensionAwaitContext(): boolean; protected invalidExtensionAwaitMessage(): string | null; protected isPredeclared(statement: object): boolean; isSubclassOf(className: string, base: string): boolean; isPrimitiveType(name: string): boolean; isPrimitiveSubtype(actual: string, expected: string): boolean; protected analyzeStatement(statement: Statement): void; /** * A canonical-form advisory may offer an editor fix only when replacing its * proven-equivalent syntax cannot silently discard an authored comment. * Both line and block comments conservatively withhold the fix, which is * preferable to erasing prose. */ private commentPreservingMechanicalFix; /** * D43 item 69 rule 6: `using` needs a scope exit to release at. The module * top level has none — it lives until the process ends. An extension whose * body is not an ordinary scope adds its own answer. */ protected ownershipScopeRejection(): string | null; protected analyzeFunctionDeclaration(statement: AnalyzableFunctionDeclaration, className: string | null, method?: boolean, declareSelf?: boolean, forceAsynchronous?: boolean, declarationKind?: string): void; /** * A target-owned declaration may use an ordinary default expression as a * typed input descriptor. The target analyzes that expression and returns * the value type visible inside the body; Core owns only the function-scope * plumbing and never learns the descriptor vocabulary. */ protected contextualFunctionParameterDefault(_statement: AnalyzableFunctionDeclaration, _parameter: AnalyzableFunctionDeclaration["parameters"][number]): ValueType | null; protected analyzeBlock(statements: readonly Statement[], narrowed?: ReadonlyMap): ReadonlyMap; protected analyzeStatements(statements: readonly Statement[]): void; protected inferExpression(expression: Expression, contextualType?: ValueType): ValueType; private inferredOrAnalyze; private hasNullishContract; private shouldNormalizeNullish; private inferExpressionType; private inferCall; /** * D114 0.28.0 B-I2: the two statement heads that have no annotation slot. * VEL2036 refuses `using r: Res = ...` — a `using` binding takes its * type from the initializer — and a `for value in ...:` head has no slot at * all, so "annotate the position" was a remedy neither one could carry out. * A head is marked while its expression is inferred, so every construction * anywhere inside it is in it, and the report that needs to know asks * `inAnnotationFreeHead`. A count rather than a flag: the mark is released by * the head that set it, on the way out of its own inference. */ private annotationFreeHeads; protected inferParameterDefault(expression: Expression, contextualType?: ValueType): ValueType; protected resolvedAsyncResult(type: ValueType): ValueType; /** Lets target analyzers inspect a child type already proven in this pass without analyzing it twice. */ protected inferredExpressionType(expression: Expression): ValueType; protected inferredFunctionResult(statement: Pick & { readonly abstract?: boolean; }): ValueType; protected narrowingFor(expression: Expression, knownType?: ValueType): ReadonlyMap; protected negativeNarrowingFor(expression: Expression, knownType?: ValueType): ReadonlyMap; protected requireCondition(type: ValueType, condition: Expression): void; private typeParameterFrame; /** D41 item 61: the ordered bound vector of a declaration, for its callable type. */ private typeParameterBoundVector; /** * D41 item 61 risk 2: only the innermost frame is consulted. A nested `def` * may not name an enclosing declaration's type parameter (VEL4021 rejects * it), so one frame is the whole visible scope. */ boundOf(type: Extract): TypeParameterBound | null; /** * The one decision procedure for "does this solved type argument satisfy * this bound", shared by the call site and the first-class value path. Each * bound reuses the predicate that already governs its capability. */ satisfiesBound(type: ValueType, bound: TypeParameterBound): boolean; private withTypeParameterFrame; private enclosingTypeParameterName; private checkTypeParameterDeclarations; private isDeclaredTypeName; private rejectErasedRuntimeCheck; /** The first class instantiation inside a runtime-checked type, if the type carries one. */ private erasedClassArgumentCheck; /** * D77 rule 194 item 2: `is Stack` and `case Stack:` are the two positions a * bare generic class name may stand in — the check is `instanceof`, which * says nothing about the arguments. Only the outermost name is allowed to be * bare; `is List` still needs `Stack`'s arity, because that check does * read the argument. */ private allowBareGenericClassName; /** * D77 rule 194 item 2: what a bare `is Stack` proves about the subject. The * check confirms the family and nothing else, so a subject that already names * its arguments keeps them, and one that does not gains the only arguments an * `instanceof` can prove — `unknown` at every position. */ private erasedClassCheckType; protected resolveAnnotation(reference: TypeReference | null): ValueType; protected resolveRawTypeReference(reference: TypeReference): ValueType; protected resolveValidatedAnnotation(reference: TypeReference | null): ValueType; protected resolveResult(reference: TypeReference | null): ValueType; protected resolveValidatedResult(reference: TypeReference | null): ValueType; protected typeError(message: string, errorSpan: Span, fix?: DiagnosticFix): void; protected recoveredTypeError(message: string, errorSpan: Span, fix?: DiagnosticFix): void; /** * D89: raises a roster advisory. It cannot reach `this.diagnostics`, so it * cannot fail a build and cannot shift the diagnostic cursors this analyzer * reads as array lengths. * * One report per code and span. `reanalyzeLoopBackEdge` runs a loop body a * second time whenever the back edge invalidates a fact, and its diagnostic * answer is `deduplicateDiagnostics`, which only ever touches * `this.diagnostics`. Deduplicating where the advisory is raised covers that * pass and every other re-analysis without a second pair of cursors, which * is the whole reason the two channels are separate arrays. */ protected advise(code: string, message: string, adviceSpan: Span, fix?: DiagnosticFix): void; /** True while analysis is directly in a declaration body rather than a function frame. */ protected inComponentSetupPosition(): boolean; moduleInitializationImportReads(): readonly InitializationImportRead[]; protected inModuleInitializationPosition(): boolean; protected markDeclaredBindingReactive(name: string, kind?: "state" | "prop"): void; protected reactiveBindingKind(name: string): "state" | "prop" | null; private runtimeTypeObjectValue; protected isBuiltinValueReference(expression: Expression, name: PermanentNamespaceName | "range"): boolean; protected applyNarrowings(narrowed: ReadonlyMap, narrowingSpan: Span): void; protected declareBinding(name: string, mutable: boolean, type: ValueType, declarationSpan: Span, internal?: boolean, declaredType?: ValueType, importSource?: string, /** * Set when this binding also introduces a *type* name, which is the one * question `builtinTypeNameDeclarationMessage` answers. A `const` or a * parameter leaves it unset: naming a local `List` shadows the built-in * value, but `List` in a type position still means the built-in there, so * the reserved-type-name rule has nothing to say about it. */ typeNamePosition?: BuiltinTypeNamePosition): void; protected isTopLevelScope(): boolean; protected markTypeNameRefused(name: string): void; /** The resolved import identity survives aliases and respects lexical shadowing. */ protected importedMemberOf(name: string): { readonly source: string; readonly imported: string | null; } | null; /** Read a checked parameter slot without repeating call planning or inference. */ protected resolvedCallArgument(expression: Extract, index: number): Expression | null; protected lookup(name: string): Binding | null; /** Shared scalar proof for target-owned argument contracts; never runs code. */ protected constantValue(expression: Expression): ConstantValue | undefined; protected prescanScopeDeclarations(statements: readonly Statement[]): void; protected enterScope(): void; protected exitScope(): void; } //# sourceMappingURL=analyzer.d.ts.map