Typescript type inference in an If statement doesn't work as a variable

前端 未结 0 1759
旧巷少年郎
旧巷少年郎 2020-11-28 21:16

Consider the following example:

class A {}
class B extends A {
    foo() {
        return 6;
    }
}

const variable: A = new B();

const isValid = variable i         


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