You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(import_elision): handle tuple type elements without panicking (#272)
* fix(import_elision): handle tuple type elements without panicking
`TSTupleElement::to_ts_type()` panicked when the element was
`TSOptionalType` or `TSRestType` (discriminants outside the inherited
`TSType` range). Switch to `as_ts_type()` for safety and add explicit
branches for those two variants.
Also adds `TSType::TSNamedTupleMember` handling in
`collect_computed_keys_from_ts_type`: named tuple members are inherited
`TSType` variants so they arrive there via `as_ts_type()`, not the
match arm that was previously added for them (which was unreachable).
Without this, computed property keys inside named tuple member element
types were silently not traversed and their imports were incorrectly
elided.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* refactor(import_elision): remove unreachable TSNamedTupleMember match arm
TSNamedTupleMember is an inherited TSType variant so as_ts_type() always
returns Some for it — the match arm added in the TSTupleType loop was
dead code. Traversal is handled by the TSNamedTupleMember arm in
collect_computed_keys_from_ts_type. Clean up the stale comment too.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
0 commit comments