basarat / typescript-book

:books: The definitive guide to TypeScript and possibly the best TypeScript book :book:. Free and Open Source 🌹
https://basarat.gitbook.io/typescript/
Other
20.87k stars 2.56k forks source link

Example of "All members must conform to the string index signature" looks wrong to me #646

Open deqing opened 3 years ago

deqing commented 3 years ago

https://basarat.gitbook.io/typescript/type-system/index-signatures#all-members-must-conform-to-the-string-index-signature

/** Error */
interface Bar {
  x: number;
  y: string; // ERROR: Property `y` must be of type number
}

Actually this example is not error