mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-01 07:33:12 +08:00
`Choice[] & GenChoice[]`, an island array extended by the caller's own choice type (pi's openrouter images: `imageResponse.choices`), was refused with SC8010. The intersection has no native IR type of its own — mapTypeOf returns null, or its arms map to different array types — so the crossing failed before the container rules that keep an array the island does not declare a handle. An intersection of containers is a container: it is a value of each arm, and where the program only uses it through island operations (member reads, an island call, an island identity test, a handle binding) it now stays a handle, exactly as an undeclared array does. Elements and fields the declaration does name cross back out on their own terms, so an element's `images` array copies, and any other use still refuses rather than inventing a native layout. Test: tests/corpus/6901-node-island-array-intersection (both shapes, the island-declared arm and the caller's own arm, differential to Node, plain and sanitized). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 lines
127 B
JSON
2 lines
127 B
JSON
{ "name": "island-array-intersection", "private": true, "type": "module", "scriptc": { "packages": { "choicekit": "node" } } }
|