mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-27 06:43:19 +08:00
A generic class instance now binds a type parameter to its checker type only when a conditional type in the class depends on it, and that checker type keys the instance. Before, every type argument was bound while only literal arguments of those parameters were in the key, so two instances such as Holder<R, "a"> and Holder<R, "b"> with a `T[K]` field shared the first instance's layout. The other parameters get no checker binding, so member types that depend on their literal identity stay unresolved, as before. Detection now follows the type aliases and interfaces a member's type refers to, so a conditional wrapped in a union alias, such as `(K extends "required" ? T : T | undefined) | null`, also separates the instances.