下面的代码在TypeScript 2.1.6上运行良好:
function create<T>(prototype: T, pojo: Object): T {
// ...
return Object.create(prototype, descriptors) as T;
}
更新到TypeScript 2.2.1后,我收到以下错误:
错误对象:'T‘类型的参数不能赋值给’TS2345‘类型的参数。
https://stackoverflow.com/questions/42421501
复制相似问题