Skip to content

A method call on a Map, an Array or a library-typed value links an unrelated project method of the same name #3036

Closed as duplicate

Description

@inth3shadows

What happens

A method call whose receiver has a declared type that is a builtin (Map, Set, Array) or comes from a library links to a project class's method that happens to share the name.

// cache.ts
export class Cache {
  has(k: string): boolean { return k.length > 0; }
}

// orch.ts
export class Orchestrator {
  private inputs: { paths: Map<string, string> } | null = null;

  check(rel: string): boolean {
    return this.inputs !== null && this.inputs.paths.has(rel);
  }
}
  • Expected: no edge. paths is a Map, so has is Map.prototype.has.
  • Actual on main (60b0d7a): Orchestrator.check calls cache.ts: Cache::has, with resolvedBy: exact-match.

In codegraph's own source, about 40 call sites do this. Examples:

  • this.detectionInputs.diskPaths.has(rel) (a Map) links to LRUCache::has;
  • this.extractor.functionTypes.includes(...) (a string[]) links to a property CfnptrFactsOut::includes;
  • actionCommand.name() (commander's Command) links to Language::name in web-tree-sitter.d.ts;
  • defaults.ignores(rel) (the ignore package) links to ScopeIgnore::ignores.

This is close to #3026 (browser globals), but here the receiver's declared type is written right there, on a field or member type, and the fallback still matches by bare name.

Found by diffing codegraph's call edges against scip-typescript on codegraph's own repo.

Activity

  1. inth3shadows commented on Oct 29, 2026

    @inth3shadows
    ContributorAuthor

    Covered by existing issues. The this.a.b.m() cases (this.inputs.paths.has() on a Map field, this.extractor.functionTypes.includes()) are #2948. The library-typed locals are #2947 (ignore().add(...)) and #2946 (a local from a factory with a declared return type). The real cases found here are added to #2948 as a comment.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions