Typescript: Index signature is missing in type
The problem is that when the type is inferred, then the type of o is: That’s not the same as { dic: { [name: string]: number } }. Critically, with the top signature you’re not allowed to do something like o.dic[‘x’] = 1. With the 2nd signature you are. They are equivalent types at runtime (indeed, they’re the exact … Read more