Narrowed-to-never string-literal union passed to a `never` parameter: SC1090 "'string' values where 'number' is expected"
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- node.js, typescript
Línea de trabajo
Start by running the provided repro.ts example with scriptc 0.4.4 and compare it with Node’s type stripping; the report identifies string literal union narrowing to never as the failing case. Then trace how the compiler lowers that narrowed value and how it checks the argument passed to unreachable. Done when the example compiles and the reported number union and typeof narrowing cases still behave as described.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Disclosure: this report was produced with the help of an AI agent (Claude Code). The agent reduced the problem from a real codebase to the repro below, ran every command shown, and drafted this text; a human reviewed it and decided to file it. The commands and outputs are real runs.
Environment: scriptc 0.4.4 (@scriptc/cli-linux-x64-gnu), Linux x86_64, Node 22.22.0. Reference behaviour from node --experimental-strip-types.
function unreachable(_: never): never { throw new Error("unreachable"); }
type K = "a" | "b";
function f(k: K): number {
if (k === "a") return 1;
if (k === "b") return 2;
return unreachable(k);
}
console.log(f(Date.now() > 0 ? "a" : "b"));
$ scriptc build repro.ts -o t
repro.ts:6:22 - error SC1090: 'string' values where 'number' is expected is not supported yet
$ node --experimental-strip-types repro.ts
1
Expected: compiles (the standard exhaustiveness-check idiom).
Observations (all run 2026-10-24)
unreachable(k as never)fails the same way.- The same program with a number-literal union (
type K = 1 | 2) compiles and prints1. typeof-narrowing astring | numbertonevercompiles and prints1.- So the failure seems specific to a string-literal union narrowed to
never, which appears to be lowered asnumber.
Context: vjuga FunctionUtils.unreachable(_: never): never, used for exhaustive switch/if chains over string-literal unions.
- Lenguaje dominante
- TypeScript
- Estrellas
- 6.4k
- Forks
- 204
- Merge medio
- 7 h 35 min
- PR fusionados (30 d)
- 873
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 Un pull request vinculado a esta issue está abierto o ya se fusionó. 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
-
Assigning a wide Node object (process.stdout) to a narrow { write } record fails SC2002 (width-copy rules)Posiblemente ocupada @ctate la tomó hoy. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
vercel-labs/scriptc#2949 ·
Los mantenedores suelen responder en 1 día
-
Analysis OOM (exit 137 at ~4 GB) on large TypeScript graphsPosiblemente ocupada @espetro la tomó hace 1 día. Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 12/100
vercel-labs/scriptc#2916 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Publish prebuilt @scriptc/libnode-* packs with the native installerPosiblemente ocupada @ctate la tomó hoy. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
vercel-labs/scriptc#2915 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
http.Server should lower off, listeners, and newListener for HTTP eventsPosiblemente ocupada @espetro la tomó hace 1 día. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 20/100
vercel-labs/scriptc#2913 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de vercel-labs/scriptc
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
vercel-labs/durable-harness#53 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: Redesign tab bars ignore clicks on Linux: hidden chat layers keep window drag regionsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
area/docs area/ui enhancement
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
melgarafael/DeskcommCRM#4098 ·
Los mantenedores suelen responder en 1 día
-
bug ready-for-agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
kerti/balances-v2#801 ·
Los mantenedores suelen responder en 1 día
-
lesson-submission pending-review
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
Ikalus1988/MisakaNet#4510 ·
Los mantenedores suelen responder en 1 día