Why does `instanceof` cause type information loss in TypeScript?

后端 未结 0 1856
暗喜
暗喜 2021-02-11 02:41

From a conversation started on GitHub:

class A {
  constructor(public value: T) {}
}

const wrap = (value: T) => {
  if (value instanceof A)         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题