Async function with a typed result rejects a returned checked-dynamic promise
Los mantenedores suelen responder en 1 día
@alantriesagain ya está trabajando en esto.
Desde el 6/11/2026.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, typescript
- Área
- compilers
Línea de trabajo
The report provides a JavaScript reproduction and says the failure also occurs on main at commit 979a65246, but names no implementation files or tests. Start by tracing how typed async function returns and concise async arrow bodies handle checked-dynamic values, then find the related compiler tests. Done means both forms adopt returned promises with the stated turn order and settle other values without an extra turn.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Async function with a typed result rejects a returned checked-dynamic promise
An async function whose result is typed checks a returned checked-dynamic value against that type directly. When the value is a promise, JavaScript resolves the function's promise with that promise: the promise is adopted, not converted as a plain value.
In our model layer, uploadFiles takes a schema whose type does not map, so its call is checked-dynamic. return uploadFiles(...) from a typed async function failed at run time with expected object at $, got Promise. Node resolves the returned promise.
/** @returns {Promise<{ id: string }>} */
async function load() {
const opaque = (value) => value;
return opaque(Promise.resolve({ id: "a" }));
}
load().then((value) => console.log(value.id));
On 0.4.8, the compiled program throws Uncaught TypeError: expected object at $, got Promise; Node prints a. The same failure reproduces on main (979a65246).
The same rule should apply to concise async arrow bodies. A promise behind the dynamic value should be adopted with the turn order of a returned typed promise: the then job's turn, then its settlement, after every crossed finally and outside the function's own catch. Any other value should settle the function at once, with no extra turn.
I opened #TBD with a patch for both forms.
- Lenguaje dominante
- TypeScript
- Estrellas
- 6.5k
- Forks
- 212
- Merge medio
- 13 h 2 min
- PR fusionados (30 d)
- 798
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
-
Discarded negation of a void call rejects valid JavaScriptPosiblemente ocupada @MathurAditya724 la tomó hace 1 día. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 1/100
vercel-labs/scriptc#3358 ·
Los mantenedores suelen responder en 1 día
-
Optional JSDoc rejects mandatory JavaScript setter parametersPosiblemente ocupada @MathurAditya724 la tomó hace 1 día. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
vercel-labs/scriptc#3355 ·
Los mantenedores suelen responder en 1 día
-
Correct JavaScript refusal descriptions for mutable bindings and missing propertiesPosiblemente ocupada @MathurAditya724 la tomó hace 1 día. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
vercel-labs/scriptc#3354 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
vercel-labs/scriptc#3330 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
vercel-labs/scriptc#3210 ·
Los mantenedores suelen responder en 1 día
Todos los issues de vercel-labs/scriptc
Issues similares
-
documentation good first issue roadmap
Dificultad 1/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
resend/react-email#3876 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
siyuan-note/siyuan#21324 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
dmno-dev/varlock#1279 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
himynameisdave/bsky-profanity-counter#59 ·
Los mantenedores suelen responder en 1 día