From 8f792280630721bdc1e6ee9199eb0cf8cb035fce Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Sun, 29 May 2016 21:45:08 -0700 Subject: Simplify erasure + mixin Remove some old, obsolete & untested hacks from ExplicitOuter. Added a test for one of them to show this is now fine. There are a lot of `makeNotPrivate` invocations sprinkled around the codebase. Lets see if we can centralize the ones dealing with trait methods that need implementations in the phase that emits them. For example Fields (accessors for fields/modules) or SuperAccessors. --- test/files/run/t2946/MyResponseCommon_2.scala | 7 +++++++ test/files/run/t2946/ResponseCommon_1.scala | 13 +++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 test/files/run/t2946/MyResponseCommon_2.scala create mode 100644 test/files/run/t2946/ResponseCommon_1.scala (limited to 'test/files/run/t2946') diff --git a/test/files/run/t2946/MyResponseCommon_2.scala b/test/files/run/t2946/MyResponseCommon_2.scala new file mode 100644 index 0000000000..4f8f924f2c --- /dev/null +++ b/test/files/run/t2946/MyResponseCommon_2.scala @@ -0,0 +1,7 @@ +class MyResponseCommon extends Parser with ResponseCommon + +object Test { + def main(args: Array[String]) { + new MyResponseCommon + } +} 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) + } +} -- cgit v1.2.3