I'm writing a ScalaTest reporter and currently I have two case class events 'TestSucceeded' and 'TestFailed', which extend 'Event' and I have a function:

```
def getInfo(event: Event) {
  println(event.suiteName)
}

```

the suiteName String is a member of both the 'TestSucceeded' and 'TestFailed' case classes, but not Event and I can't find a better way of implementing than

```
def getInfo(event: Event) {
  if(event.isInstanceOf[TestSucceeded])
    println(event.asInstanceOf[TestSucceeded].suiteName)
  else println(event.asInstanceOf[TestFailed].suiteName)
}

```