mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-07 08:33:50 +08:00
A record parameter of a function the record-flow analysis does not track widens to the fields its own arguments can leave undefined, and since the flow-class change those arguments include object literals and call results. Another call can pass that parameter a value stored as `R | undefined`: a for-of element whose loop the element analysis cannot prove free of holes binds `R | undefined` while the checker types it `R`. Coercing that union into the widened layout of R found no mapping and failed with SC2003, where the declared parameter used to take the checked extraction of the record arm. A union of one record arm and unit arms flowing into a record that arm lifts to now takes the same checked extraction, then the record's width lift into the destination layout.