/** * Receiver-bound CALLS / ACCESSES emit pass — generic 8-case * dispatcher consuming `ScopeResolver` for the language-specific bits * (super recognizer, field-fallback toggle). * * **Contract Invariant I4 — case order is load-bearing.** The cases * are evaluated in this order; the FIRST that emits an edge wins: * * 1. **super branch** — `provider.isSuperReceiver(receiverName)` → * MRO walk skipping self * 2. **Case 0 (compound)** — receiver has `.` or `(` → compound resolver * 3. **Case 0.5 (implicit `this` receiver)** — GATED: fires only when * the language sets `resolveThisViaEnclosingClass === true` AND the * receiver is literally `this` → enclosing-class + MRO chain walk * with C++ member-name-hiding semantics. Languages that leave the * toggle unset skip this case entirely; their `this` sites fall * through to Case 4 via the synthesized `this` typeBinding (which * also emits interface-dispatch fan-out that this case does not). * 4. **Case 1 (namespace)** — receiver in `namespaceTargets` → exported def * 5. **Case 2 (class-name / static receiver)** — receiver resolves to a * class-like binding (Class/Interface/Struct/Record/Enum/Trait) → MRO * walk on that class. Also handles static-style invocations * (`ILogger.Warn(...)`) with kind-aware reason/confidence for * read/write ACCESSES. * 6. **Case 3 (dotted typeBinding for namespace prefix)** — * `typeRef.rawName` like `models.User` * 7. **Case 3b (chain-typebinding)** — `typeRef.rawName` has a dot * but not a namespace prefix → compound resolver * 8. **Case 4 (simple typeBinding)** — `typeRef.rawName` has no dot → * MRO walk + `findOwnedMember` * 9. **Case 5 (value-receiver bridge)** — receiver is a `Const`/`Variable` * whose `nodeId` is referenced as an `ownerId` in `model.methods` * (object-literal services). Last-resort fallback for lowercase * receivers with no class-like or type-binding match. Mirrors * the legacy DAG bridge in `call-processor.ts`. * * Reordering or merging cases changes resolution semantics. * * **Contract Invariant I5 — pre-seeding `seen` is forbidden.** The * orchestrator runs this pass FIRST (before `emitReferencesViaLookup`) * and consumes the populated `handledSites` set. Pre-seeding `seen` * from the shared resolver's emissions (an old optimization) actively * suppresses correct emissions for sites the shared resolver also * resolved to a wrong target. */ import type { ParsedFile } from '../../../../_shared/index.js'; import type { KnowledgeGraph } from '../../../graph/types.js'; import type { ScopeResolutionIndexes } from '../../model/scope-resolution-indexes.js'; import type { SemanticModel } from '../../model/semantic-model.js'; import type { ScopeResolver } from '../contract/scope-resolver.js'; import type { GraphNodeLookup } from '../graph-bridge/node-lookup.js'; import type { WorkspaceResolutionIndex } from '../workspace-index.js'; import type { CalleeIdSink } from '../graph-bridge/callee-id-sink.js'; import type { ResolutionOutcomeRecorder } from '../resolution-outcome.js'; /** Subset of `ScopeResolver` consumed by this pass. Accepting the * subset rather than the full provider keeps tests and partial * refactors lighter — callers only need to populate what we read. */ type ReceiverBoundProviderSubset = Pick; export declare function emitReceiverBoundCalls(graph: KnowledgeGraph, scopes: ScopeResolutionIndexes, parsedFiles: readonly ParsedFile[], nodeLookup: GraphNodeLookup, handledSites: Set, provider: ReceiverBoundProviderSubset, index: WorkspaceResolutionIndex, model: SemanticModel, options?: { readonly recordResolutionOutcome?: ResolutionOutcomeRecorder; /** Resolved-callee-id capture sink (#2227 U2). Threaded in only under * `--pdg`; `undefined` ⇒ zero overhead, byte-identity (R4). Per-file * capture contexts are built from this + `parsed.filePath` in the loop. */ readonly calleeIdSink?: CalleeIdSink; }): number; /** * Sentinel returned by `pickOverload` when narrowing leaves >1 candidate * sharing identical normalized parameter-types. Callers should suppress * the CALLS edge AND mark the site as handled so `emitReferencesViaLookup` * does not re-emit from the pre-resolved reference index. See * `pickOverload` JSDoc for the upstream cause (per-language normalizer * collapses distinct types in arity-metadata). */ export declare const OVERLOAD_AMBIGUOUS: unique symbol; export {};