It depends how you construct Dog and Cat. With Javascripts dynamic prototype chain, you could never know for sure.
Try it
https://www.typescriptlang.org/play/?#code/C4TwDgpgBAIg9gcyg...
Try it
https://www.typescriptlang.org/play/?#code/C4TwDgpgBAIg9gcyg...