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

后端 未结 0 1607
盖世英雄少女心
盖世英雄少女心 2021-02-11 02:47

From a conversation started on GitHub:

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

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


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