Siblings of #3756: untyped-receiver built-in method calls in other languages

Open
#4,991 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
38/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Domain
tooling

Research direction

Start with _resolve_one and the _BUILTIN_INSTANCE_METHODS and _BUILTIN_NAMESPACES lists in gitgalaxy/core/call_resolver.py; compare how each language reaches the untyped receiver fallback. Check the TypeScript leftover in zod and use the language Level 2 checks in tests/tools/call_graph_resolution.py where available. Done means the affected built-in calls no longer link confidently to same-named repository methods, with each language's behavior measured or its fallback ruled out.

Written by the indexing model from the issue text.

Description

bug Compiler call-graph comparison core-engine priority: medium scope:infra

Siblings: #3756 (fixed for TS/JS in #4990)

Class: a call through an untyped, non-this receiver whose method name is a language built-in (s.trim(), m.get(), list.add()) links confidently (file/import) to a same-named repo method. #4990 fixed it in the resolver's untyped-receiver fallback (_resolve_one, gitgalaxy/core/call_resolver.py) with per-language lists _BUILTIN_INSTANCE_METHODS / _BUILTIN_NAMESPACES, filled only for TypeScript/JavaScript. The fallback itself is language-generic, so the other languages hit by it keep the bug until their lists exist and are measured.

Same mechanism for each box: add the language's built-in instance-method names (and global namespaces where relevant) and measure with that language's Level 2 check where one exists (tests/tools/call_graph_resolution.py). Before adding a list, check that the language really reaches this fallback with built-in names (duplicate search done per member: no open issue found).

  • TypeScript leftover: handleMapResult -> util.ts has@696 on zod@2bf7b0630d53, the last confident_external, reached by a step #4990 does not cover. Diagnose it.
  • Python: check whether calls_out_qualifiers (d.get() on a dict) already covers the whole built-in class (str/list/dict/set methods); pyan Level 2 does not flag lib targets as external, so measure some other way.
  • Java: java.lang/java.util methods (list.add, map.get, s.equals, toString); scip-java Level 2 is the reference.
  • Kotlin: stdlib collection/String methods. (#6466)
  • C#: BCL methods (List.Add, Dictionary.TryGetValue, string.Trim); no Level 2 reference yet.
  • Ruby: core methods (each, map, include?, []); no Level 2 reference yet.
  • PHP: method-only (built-ins are mostly free functions); confirm and close the box if nothing reaches the fallback.
  • Go: methods on stdlib types (strings.Builder.WriteString, bytes.Buffer); confirm whether untyped receivers reach the fallback.
Dominant language
Python
Stars
57
Forks
11
Avg merge
1h 35m
Merged PRs (30d)
975

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from squid-protocol/gitgalaxy

All issues in squid-protocol/gitgalaxy

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.