TypeScript Version: 3.2.2
Search Terms: mapped types index signature incompatible function
Code
declare const fn: <K extends string, V>(object: { [Key in K]: V }) => object;
declare const a: { [index: string]: number };
/*
Argument of type '{ [index: string]: number; }' is not assignable to parameter of type '{ [x: string]: never; }'.
Index signatures are incompatible.
Type 'number' is not assignable to type 'never'.
*/
fn(a);
TypeScript Version: 3.2.2
Search Terms: mapped types index signature incompatible function
Code