【发布时间】:2019-06-09 17:13:57
【问题描述】:
当我在 TypeScript 中使用以下构造函数时,我收到错误 Argument type this is not assignable to parameter type ObjectConstructor。但是 CLI 没有显示错误。代码对我来说看起来不错 (syntax)。这是错误的错误吗?
export class Store{
oid: string;
storeNumber: string;
address: string;
public constructor(init?: Partial<Store>) {
Object.assign(this, init);
}
}
【问题讨论】:
-
我遇到了同样的问题。当我切换到 VSCode 时,没有错误。看起来像 webstorm 问题
标签: typescript webstorm