mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-14 15:58:08 +08:00
`[...maybe]` over a source the checker typed wider than the iterable it holds at run time (`T | undefined` from an indexed read under indexed-access strictness, an optional local) and `push(...value)` over an untyped or widened source were SC1090 refusals. They now drain through the checked iterator walk, validating each element into the target slot, and throw Node's not-iterable TypeError for null/undefined. `widenedIterableType` recognises a union of exactly one iterable arm plus unit arms; `checkedIteratorPack` is exported so the array-method spread path reuses the same walk. Corpus 8504 covers `[...digit]` from a `string | undefined`, a `[...any]` array literal, a `push(...any)`, and `push(...(provider.x ?? []))`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>