ReviewOS

home-lang/home

fix(ts): elide large inline object shapes in TS2339 diagnostics

#971
Closed glennmichael123 opened this 13 hours ago ·
13 hours ago

Found while verifying #960's [Symbol.unscopables] diagnostic. Related: #846, #66.

TypeScript 5.7.3 truncates large anonymous object shapes in TS2339 using its 160-unit type-node budget and preserves the last property. A local control with 12 optional boolean properties prints p1 through p7, ... 4 more ..., then p12. Home prints all 12 properties because its existing allocSimpleTypeName inline-object branch returns before allocPropertyMissingTargetTypeName can use the truncating object-shape renderer. With 20 members the mismatch grows further.

Acceptance: route inline anonymous object diagnostics through the same declaration-order, optional/readonly/indexer-aware type-node display used for mapped objects; match TypeScript 5.7.3 for the 11, 12, and 20-member controls without changing semantic member lookup. Add exact CLI oracle fixtures and guarded checker/Program/LSP verification. Avoid a string replacement in the emitted error.

9 hours ago

Fixed and pushed in 37f34d9. Anonymous TS2339 object displays now use the existing declaration-order type-node-budget renderer before the general simple-name printer. The matched TypeScript 5.7.3 controls for 11, 12, and 20 optional properties all match exactly within the 145/145 CLI stream audit. Focused checker regression and direct full checker 4,739/4,739 passed; guarded Program 473/473, LSP 144/144, diagnostics 25/25, pickier, and diff checks passed. Closing this scoped issue; #960 remains open for #970 unique-symbol identity.

Sign in to comment on this issue.