Suppose I have
val flag = true
why does the type result in Product with Serializable with Animal instead of just Animal?
class Animal(name : String)
case class Herbivore(name : String) extends Animal(name)
case class Carnivore(name : String) extends Animal(name)
val cow = new Herbivore("cow")
val tiger = new Carnivore("tiger")
if (flag) cow else tiger // Why is type Product with Serializable with Animal?