TypeScript: functions imported from node: built-ins resolve to same-named project functions
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- node.js, typescript
- Área
- tooling
Línea de trabajo
Start by tracing how TypeScript imports are bound and how call edges resolve names; the issue does not identify specific source files or tests. Reproduce the minimal case with the node:path and node:fs imports, then check that imported external functions no longer link to same-named project functions while project imports still resolve.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happens
In TypeScript, a bare call to a function that is imported by name from a Node built-in module links to an unrelated project function with the same name. The import binding is ignored.
Minimal repository (CodeGraph 1.6.1, codegraph init):
// src/policy.ts
export function resolve(input: string): string { return `policy:${input}`; }
export function relative(a: string, b: string): string { return `${a}->${b}`; }
// src/io.ts
export function existsSync(path: string): boolean { return path.length > 0; }
// src/paths.ts
import { resolve, relative } from 'node:path';
import { existsSync } from 'node:fs';
export function toAbsolute(root: string, file: string): string { return resolve(root, file); }
export function toRelative(root: string, file: string): string { return relative(root, file); }
export function present(file: string): boolean { return existsSync(file); }
calls edges in the index:
toAbsolute (src/paths.ts) -> resolve (src/policy.ts)
toRelative (src/paths.ts) -> relative (src/policy.ts)
present (src/paths.ts) -> existsSync (src/io.ts)
src/paths.ts does not import src/policy.ts or src/io.ts. All three callees are node:path / node:fs functions.
Impact
On a real TypeScript repository (about 1,100 files) the same shape appears for resolve, relative, existsSync, readFileSync and unlinkSync. The project functions with those names collect many unrelated callers, so callers, impact and call-path answers for them are wrong. A tool that uses direct calls edges as proof of a call accepts these false edges.
Expected
When the callee identifier is bound by an import from a module that is not part of the project (a node: built-in, a bare built-in such as 'path' or 'fs', or an external package), the call does not resolve to a project symbol by name. It stays unresolved, or it links to an external placeholder. Calls whose binding resolves to a project file still resolve normally.
Related but different: #1987 (built-in methods on untyped receivers) and #1566 (Map.get/set/has). This case is a bare function call with an explicit import binding.
- Lenguaje dominante
- C
- Estrellas
- 73.2k
- Forks
- 4.7k
- Merge medio
- 2 h 16 min
- PR fusionados (30 d)
- 423
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de colbymchenry/codegraph
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
colbymchenry/codegraph#2634 ·
Los mantenedores suelen responder en 1 día
-
Windows: bundled Node v24.16.0 can abort at exit (nodejs/node#56645); please bundle Node >= 24.20.0Posiblemente ocupada @Ancienttwo la tomó hace 3 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
colbymchenry/codegraph#2617 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Invalid regular expression: /\boperator++\s*(?:<[^<>()]*>)?\s*\(/: Nothing to repeat (v1.6.2)Abierto
Dificultad 2/5 Menos de una hora Aptitud para principiantes 72/100
colbymchenry/codegraph#2482 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
codegraph ui - does not workAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
colbymchenry/codegraph#1900 · 2 comentarios · 5 reacciones ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
colbymchenry/codegraph#1700 ·
Los mantenedores suelen responder en 1 día
Todos los issues de colbymchenry/codegraph
Issues similares
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
EchoTools/nevr-runtime#698 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
FujiNetWIFI/fujinet-firmware#2079 ·
Los mantenedores suelen responder en 1 día
-
bug Official Image release/25.12 Supported Device target/kirkwood
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
area/archive bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
DarkFlippers/qUnleashed#374 ·
Los mantenedores suelen responder en 1 día
-
Missing options in yara man pageAbiertobug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
VirusTotal/yara#2255 ·