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

Chiusa
#2,948 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
22/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
compilers

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
6.4k
Fork
204
Merge medio
7h 45m
PR unite (30g)
845

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di vercel-labs/scriptc

Tutte le issue di vercel-labs/scriptc

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.