爲什麼對象的constructor
字段沒有構造體簽名?Typescript:構造函數字段缺少構造體簽名
class X {
}
const x = new X
// disallowed:
// const y = new x.constructor
// cast to any just to see runtime behaviour:
const z = new (x.constructor as any)
console.log(z)
毫無疑問,有一個非常好的類型相關的原因,但我不明白它是什麼。