TypeScript/tests/cases/compiler/mappedTypeMultiInference.ts
Wesley Wigham 53ae507545
Add inference priority for mapped type keys (#22246)
* Add inference priority for mapped type keys

The new priority causes union inference, similarly to return type

* Rename priority

* Fix comment typo
2018-03-05 13:19:00 -08:00

21 lines
361 B
TypeScript

interface Style {
flashy: any;
}
declare function mergeStyleSets<K extends string>(
...cssSets: { [P in K]?: Style }[]): { [P in K]: Style };
// Expected:
// let x: {
// a: Style;
// b: Style;
// }
let x = mergeStyleSets(
{},
{
a: { flashy: true },
},
{
b: { flashy: true },
},
)