From 89bacb9c25a58454ff1878e67f7ea07ffc8c269f Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Tue, 12 May 2015 18:30:53 +0200 Subject: Run tests as they were in scala. --- .../run/reflection-modulemirror-toplevel-good.scala | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/pending/run/reflection-modulemirror-toplevel-good.scala (limited to 'tests/pending/run/reflection-modulemirror-toplevel-good.scala') diff --git a/tests/pending/run/reflection-modulemirror-toplevel-good.scala b/tests/pending/run/reflection-modulemirror-toplevel-good.scala new file mode 100644 index 000000000..0663136a2 --- /dev/null +++ b/tests/pending/run/reflection-modulemirror-toplevel-good.scala @@ -0,0 +1,20 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.reflect.ClassTag + +object R { override def toString = "R" } + +class Foo{ + import Test._ + def foo = { + val classTag = implicitly[ClassTag[R.type]] + val sym = cm.moduleSymbol(classTag.runtimeClass) + val cls = cm.reflectModule(sym) + cls.instance + } +} + +object Test extends App{ + val foo = new Foo + println(foo.foo) +} \ No newline at end of file -- cgit v1.2.3