aboutsummaryrefslogtreecommitdiff
path: root/tests/patmat/t9573.scala
blob: 2a32c2599f230b8305715c41a3e1db8629cd0e82 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
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")
    }
  }
}