typescript-book-chinese
typescript-book-chinese copied to clipboard
通过接口 A<T>,为什么 A<string> 可赋值给 A<number>? 这个解析貌似错误的。
![1111](https://user-images.githubusercontent.com/38155265/151273933-2d605c12-ba82-4401-82e7-74b60fd012df.png)
我的TS版本为:^4.3.4
我在VScode 尝试了一下你的demo,并不会发生转换。赋值虽然成功,并不会改变泛型。 其实这个例子本质没啥意义,当作探索TS边界挺好的。