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.58k stars 2.52k forks source link

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

Open deqing opened 2 years ago

deqing commented 2 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