You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to use user-defined type guards in the following manner:
abstractclassAnimal{getisDog(): this is Dog;}classDogextendsAnimal{getisDog(): this is Dog{returntrue;}bark(){console.log("woof");}}letanimal=newDog();if(animal.isDog){animal.bark()}
This use-case was suggested by @RyanCavanaugh when he opened #1007 but seems to be unsupported as of TypeScript 1.6.