jkchao / typescript-book-chinese

TypeScript Deep Dive 中文版
https://jkchao.github.io/typescript-book-chinese/
MIT License
6.51k stars 675 forks source link

函数参数类型这章节有误 #288

Open duriann opened 8 months ago

duriann commented 8 months ago

https://jkchao.github.io/typescript-book-chinese/typings/typeCompatibility.html#%E5%87%BD%E6%95%B0%E5%8F%82%E6%95%B0%E7%B1%BB%E5%9E%8B

image 划红线这段放ts里报错了

duriann commented 8 months ago

Type '(point: Point3D) => void' is not assignable to type '(point: Point2D) => void'. Types of parameters 'point' and 'point' are incompatible. Property 'z' is missing in type 'Point2D' but required in type 'Point3D'.(2322) input.tsx(8, 3): 'z' is declared here.