Assigning a wide Node object (process.stdout) to a narrow { write } record fails SC2002 (width-copy rules)
Los mantenedores suelen responder en 1 día
@ctate ya está trabajando en esto.
Desde el 5/11/2026.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- node.js, typescript
- Área
- compilers
Línea de trabajo
Start from the SC2002 diagnostic and the record-shape flow check that emits it, then reproduce with the minimal case: const sink: Sink = process.stdout where Sink is { write(s: string): void }. The open question is whether width-copy should accept this direction or whether the subset should document the wrapper adapter as the blessed pattern. Done means a maintainer-chosen behavior, with either a passing test for the accepted case or a docs entry for the adapter.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
Assigning process.stdout (a WriteStream) to a parameter/interface typed as a minimal { write(str: string): void } record fails with SC2002 "record shape flow outside the width-copy rules". The concrete Node type has many more members than the target record; the subset's record-flow rules refuse the width mismatch rather than copying the needed member.
Actual (scriptc 0.4.7)
interface Sink { write(s: string): void }
const sink: Sink = process.stdout; // SC2002
(Exact repro program available; compiled with scriptc build / compile() so the IR validator runs.)
Expected
Either:
- structural acceptance when the target record's members are all present on the source type (width-copy in the safe direction), or
- a documented seam: e.g. wrap the wide Node object in a narrow adapter (
const sink: Sink = { write: (s) => process.stdout.write(s) }), if that is the blessed pattern it would help to say so in the subset docs.
Downstream evidence
T3 Code's ACP MCP stdio fast path wants to hand process.stdout to a helper typed as a minimal writer (AcpMcpStdioBridge.ts output: process.stdout). The wrapper workaround is cheap for us, so this is quality-of-life for the subset's ergonomics, not a blocker once we know the blessed shape.
- Lenguaje dominante
- TypeScript
- Estrellas
- 6.4k
- Forks
- 204
- Merge medio
- 7 h 45 min
- PR fusionados (30 d)
- 845
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
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 vercel-labs/scriptc
-
`process.execPath` uses the ANSI API on Windows, so non-ASCII paths are garbled when the ANSI code page is not UTF-8Posiblemente ocupada @ctate la tomó hace 1 día. Abierto
Dificultad 2/5 Medio día Aptitud para principiantes 72/100
vercel-labs/scriptc#2910 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 42/100
vercel-labs/scriptc#3048 ·
Los mantenedores suelen responder en 1 día
-
Object-shape and declaration-assignment diagnostics describe the wrong JavaScript behaviorPosiblemente ocupada @MathurAditya724 la tomó hace 1 día. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
vercel-labs/scriptc#3037 ·
Los mantenedores suelen responder en 1 día
-
Optional setter JSDoc is mistaken for optional executable syntaxPosiblemente ocupada @MathurAditya724 la tomó hace 1 día. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
vercel-labs/scriptc#3036 ·
Los mantenedores suelen responder en 1 día
-
Valid legacy regex fragments are rejected before native compilationPosiblemente ocupada @MathurAditya724 la tomó hace 1 día. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
vercel-labs/scriptc#3035 ·
Los mantenedores suelen responder en 1 día
Todos los issues de vercel-labs/scriptc
Issues similares
-
Navbar avatar and name stay stale after saving profile changesPosiblemente ocupada @alexechoi la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
marmelab/atomic-crm#416 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
epam/ai-dial-react-file-manager#99 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
canonical/craft-actions#146 ·
Los mantenedores suelen responder en 2 días
-
feature-request
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
bluesky-social/social-app#12343 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
lucide-icons/lucide#5165 ·
Los mantenedores suelen responder en 1 día