mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-01 07:33:12 +08:00
The species lowering for a callback method rebuilt its `%arr.<method>` call by shape — the result had to be a call taking the receiver as its first argument — so two forms the method lowering does produce fell to SC1090 whenever the program declared a class that extends Array: - a filter whose callback narrows: the filtered array comes back through the checked-narrowing wrapper, `call(%arr.narrow, [call(%arr.filter, …)])`, and the species path saw a call whose first argument is not the receiver; - a flatMap whose callback returns a union with an array arm, which lowers to `%arr.flatMap.<n>` — a helper boundedArrayHofHelper rejected because arrHofInfo, which holds the pipeline-fusable helpers, has no entry for it. The call is now found by walking the expression for the `%arr.` helper call over the receiver, whatever wraps it, and boundedArrayHofHelper accepts any `%arr.` helper (forEach excepted, it makes no array), so the union flatMap earns a bounded variant. Hidden locals are still declared in the old order, so a program that compiled before gets byte-identical IR. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>