mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-08 08:44:37 +08:00
widthLiftPlan had no arm for a record into a record whose destination
declares an index signature, so every nested position that plans through
it (a union arm, a field, an array element) refused the pair with SC2003
even though widthCoerce already compiles the same pair at top level.
Split lowerRecordOvfCaptureHelper into a pure recordOvfCapturePlan (the
same gates, no interning, no observable state, recursion-guarded like
recordWidthPlan) and the existing builder, return { how: "ovf" } from the
width relation for those pairs, and build the capture call in
applyWidthLift. The destination is still a fresh copy, the stance every
width conversion already takes, and no pair that compiled before changes
shape, since recordWidthPlan returns null for index-signature targets.
Adds corpus program record-ovf-union-arm.ts (a tagged index-signature
record narrowing into an index-signature union arm), its corpus cost and
its preflight/order baseline.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>