mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-04 08:04:37 +08:00
An object spread of a union with several record arms was refused. Two cases are now lowered. Where the checker narrowed the source to fewer arms than its stored union holds (an optional-chain discriminant test on an element read, a type predicate), the source converts through the checked narrowing, so an excluded arm throws the catchable TypeError, and the narrowed record spreads as before. A union spread into one declared record copies each arm's own keys behind its tag test: a key the running arm lacks keeps the earlier value or stays absent. One record arm emits the same code as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>