mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-03 07:54:40 +08:00
A promise or function value flowing into a union whose only arm of that kind has a wider payload or result (`Promise<T>` into `Promise<unknown> | undefined`, `(s) => Promise<string | null>` into an optional `(s) => Promise<string | null | undefined>` member) was refused with SC2003: an arm value wrapped into a union only when the union held an identical arm. It now takes the arm-level conversion (the checked payload widening, the function adapter) and wraps the result. `p === u` against such a union compares both sides as untyped values, so a promise keeps its identity although converting it into the union's arm builds a new promise. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>