Effect.fn reusable generator helpers fail with SC2001 (type outside the compilable set)

Cerrado
#2,948 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
22/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
typescript
Área
compilers

Línea de trabajo

The failure is the SC2001 diagnostic raised at an Effect.fn(...) call site in the compiler's type-subset check, so start by finding where SC2001 is emitted and which type the Effect.fn return falls outside of. The issue says Effect.gen already lowers, which gives a working comparison. Done means either Effect.fn generators compile, or the subset docs state a supported alternative. The maintainer has not chosen between those two options, so confirm the direction before writing code.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Summary

Effect.fn("tag")(function* () { ... }) from effect/Effect fails to compile with SC2001 "type outside the compilable set" on the helper's call site. The generic Effect.fn return (an overloaded callable whose return type is Effect<A, E, R> parameterized by the generator's yields) is the type outside the compilable set.

Actual (scriptc 0.4.7)

A minimal program importing effect/Effect, defining an Effect.fn(...) generator function with Effect.fn.Return<A, E> annotated yields, and running it via Effect.runPromise, fails with SC2001 at the Effect.fn call.

Expected

Either:

  • Effect.fn generators lower (the pattern is the project's blessed style for reusable Effect functions), or
  • a documented workaround / supported shape (e.g. plain Effect.gen at the call site, which does lower today) is stated in the subset docs.

Downstream evidence

T3 Code's ACP MCP fast paths (apps/server/src/mcp/AcpMcpStdioBridge.ts, 398 LOC: Effect.fn blocks for send/request/handleServerPayload/launch) hit exactly this when compiling per-entrypoint ELFs. The import closure is small (3 modules of ours, ~457 LOC) but pulls the whole Effect core (83 modules, ~76k LOC), and Effect.fn is the first thing that fails. Rewriting to Effect.gen is our workaround candidate, but Effect.fn is idiomatic and everywhere in the codebase, so a lowering or a blessed alternative matters beyond one file.

Lenguaje dominante
TypeScript
Estrellas
6.5k
Forks
212
Merge medio
13 h 2 min
PR fusionados (30 d)
798

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de vercel-labs/scriptc

Todos los issues de vercel-labs/scriptc

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.