summaryrefslogtreecommitdiff
path: root/test/files/run/t2946/ResponseCommon_1.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run/t2946/ResponseCommon_1.scala')
-rw-r--r--test/files/run/t2946/ResponseCommon_1.scala13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/files/run/t2946/ResponseCommon_1.scala b/test/files/run/t2946/ResponseCommon_1.scala
new file mode 100644
index 0000000000..bb921e7027
--- /dev/null
+++ b/test/files/run/t2946/ResponseCommon_1.scala
@@ -0,0 +1,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)
+ }
+}