You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(core): fail-fast Defect when bind/let gets a non-object scope
bind/let live on the general Result surface, so a primitive Ok (e.g.
Ok(5).bind(...)) could reach the scope merge and `{ ...5 }` would
silently collapse to `{}`, dropping the prior scope. Route the merge
through a `scopeOf` guard that throws on a non-object value; the
surrounding try turns it into a Defect — misuse surfaced as the bug it
is, not a silent drop. Covers sync + async bind/let. A `this: object`
constraint was rejected: TS does not hard-enforce a constraint inferred
solely from `this`, and it breaks `AsyncRes implements AsyncResult`.
Also fix two doc snippets to import the constructors they use
(do-notation `Ok`, index `Defect`).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments