summaryrefslogtreecommitdiff
path: root/test/files/run/t2946/ResponseCommon_1.scala
blob: bb921e7027b98459ccc9255527e44961fb37e8c3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
class Parser {
  def parse(t: Any): Unit = {}
}

trait ResponseCommon extends Parser {
  private[this] var paramsParser: Parser = null
  def withParamsParser(parser: Parser) = {paramsParser = parser; this}

  override abstract def parse(t: Any): Unit = t match {
    case ("params", value: List[_]) => value.foreach {paramsParser.parse(_)}
    case _ => super.parse(t)
  }
}