mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-02 07:43:42 +08:00
`p?.catch(h)`, `p?.then(h)` and a guarded chain tail (`f()?.then(h)`) were refused: the promise-method lowering rejected every `questionDotToken` instead of asking whether the optional chain was currently being lowered, so the guarded body never reached it. It uses `chainBlocked` now, like every other lowering that rides the chain. The call that ENDS a chain checker-types as the chain's undefined-armed union (`Promise<T> | undefined`) while this lowering builds the promise arm, which `finishOptionalChain` wraps back into the union. The handler's result type takes that arm, so the handler is typed against the promise it actually handles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>