blob: 2a32c2599f230b8305715c41a3e1db8629cd0e82 (
plain) (
tree)
|
|
class Foo {
def foo = {
abstract sealed class Animal
case class Goat(age: Int) extends Animal
case class Horse(age: Int) extends Animal
val x: Animal = Goat(1)
x match {
case Goat(_) => println("a goat")
}
}
}
|