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

クローズ
#2,948 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
22/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript
領域
compilers

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
6.5k
フォーク
212
平均マージ
9時間 48分
マージ済み PR(30日)
795

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

vercel-labs/scriptc のほかの issue

vercel-labs/scriptc の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。