Skip to content

[TS/JS] A spread call ...f() records qualifier <expr>, so a bare call resolves as an untyped receiver and finds nothing #3787

Closed

Description

@squid-protocol

What

In a spread argument or property, ...parseCaseValue(value) and { ...makeBig(i) }, the detector records the callee's qualifier as <expr>, as if the call were (expression).parseCaseValue(). The resolver treats <expr> as an untyped receiver, which only a method can answer. The same-file function parseCaseValue is a binding, reachable only by a bare call, so the pair resolves to none (external) and draws no edge.

The same happens to a qualified call behind a spread (...errorUtil.errToObj(message)): the qualifier should be errorUtil.

Evidence

  • Size: callgraph_triage.py typescript (callgraph_triage.py: bucket every missed and wrong call link into a ranked backlog #3774) on zod puts 51 reference edges in resolved_outside because of this: 40 ...f() and 11 ...ns.f().
  • explain_call.py on packages/bench/compile-vs-arktype.ts:parseArgs, callee parseCaseValue:
    parseCaseValue: none -- no definition this caller can reach (external)  qualifier '<expr>'
      packages/bench/compile-vs-arktype.ts:45 parseCaseValue owner=- shape=binding kind=function reach=bare same-file
    
  • Source: packages/bench/compile-vs-arktype.ts:72 is requestedCases.push(...parseCaseValue(value));, and packages/bench/memory/leaks.ts:71 is bigSchema.parse({ ...makeBig(i), n: "not-a-number" });.

Fix

In the TS/JS qualifier capture (calls_out_qualifiers), a ... spread operator before the callee isn't a member access. ...f() is a bare call (qualifier ""), and ...ns.f() has qualifier ns. Add extraction tests for both, then measure with callgraph_check.py.

Activity

  1. added
    bug
    core-engine
    on Sep 26, 2026
  2. added
    scope:infra
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcore-enginescope:infra

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions