mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-09 09:48:15 +08:00
A function value's declared type may name fewer parameters than the function it holds, and a later widening call then passes arguments the declared type never spelled. JavaScript's function object carries all of its parameters, so nothing may be dropped on that path — that would be a silent divergence from Node. The narrowed store is already a named refusal (a compiled function value is one concrete native ABI: "'(string, number) => number' values where '(string) => number' is expected"), reported at the narrowing site for a binding and for an object-literal member slot. Record both in the diagnostics snapshot so the refusal cannot regress into a silent drop. Pin the shapes that DO keep every argument: a class member whose overloads spell fewer parameters than its implementation, the member read as a value (the read keeps the implementation's JS arity), and a value that entered through an untyped slot and is widened back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 94d44e947c48dc0184c941d526380ebd1b1b443d)