mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
cfd97da680
1. When inferring from a string literal [union] type to a index type,
infer a object type with properties whose names match the constituents of the
union type. The type of all the properties is `{}`.
2. Infer index types contravariantly.
For example, when inferring `"foo" | "bar"` to `keyof T`, the inference
algorithm now infers `{ foo: {}, bar: {} }` to `T`. When inferring
`string` to `keyof T`, the inference algorithm now infers `{ [s:
string]: {} }` to `T`.