Files
scriptc/packages
Malte UblandClaude Opus 5.5 c294d129d0 Filter a union of arrays arm by arm
`.filter` on `A[] | B[]` refused with SC2020: `lowerArrayUnionHofCall`
admitted only `map` and `forEach`. Under TS 5.2's callable-union rule the
predicate runs over `A | B`, and the result element is the one the
predicate names — `(b): b is TextContent` over a union of block arrays
answers `TextContent[]` — which no single arm's element need equal.

`filter` joins the same arm dispatch: each arm filters its own concrete
array through the existing per-arm helper, and its survivors then pass
through the checked conversion to the checker's result element, so a
predicate that kept an element it does not describe throws instead of
reinterpreting a value. An arm with no such conversion (a boolean
predicate that names no narrower element) leaves the SC2020 fence in place.

Typed programs are untouched: the gate only widens, and `map`/`forEach`
keep their exact helper key, so the helpers a program already emitted stay
byte-identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 19:11:10 -07:00
..
2026-10-29 06:02:00 -05:00
2026-10-29 06:02:00 -05:00
2026-10-29 06:02:00 -05:00
2026-10-29 06:02:00 -05:00
2026-10-29 06:02:00 -05:00
2026-10-29 06:02:00 -05:00
2026-10-29 06:02:00 -05:00
2026-10-29 06:02:00 -05:00
2026-10-29 06:02:00 -05:00
2026-10-29 06:02:00 -05:00
2026-10-29 06:02:00 -05:00
2026-10-29 16:39:31 -05:00
2026-10-29 06:02:00 -05:00
2026-10-29 06:02:00 -05:00
2026-10-29 15:55:05 -05:00
2026-10-29 06:02:00 -05:00
2026-10-29 06:02:00 -05:00