mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-22 05:59:31 +08:00
A parameter that is rebound only by statement assignments of walk projections (`source = (source as LiteralType).regularType`) used to become an owned parameter: every caller retained the argument, the callee released it on exit, and each rebinding retained the new value and released the old. In an edge-preserving function its incoming value is the caller's borrow and every later value is reachable from the parameters, so it can stay borrowed like any walk local. The walk analysis now runs once per module before call lifetimes, which merge these parameters into the borrowed set. Unchanged-parameter users (stable call arguments and aliases, frame-long array element borrows) still only see parameters that are never rebound. tsc-ts's isTypeRelatedTo, which normalizes fresh literal types this way on entry, no longer touches reference counts for its type arguments.