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. --- .../reflection-modulemirror-inner-badpath.scala | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/pending/run/reflection-modulemirror-inner-badpath.scala (limited to 'tests/pending/run/reflection-modulemirror-inner-badpath.scala') diff --git a/tests/pending/run/reflection-modulemirror-inner-badpath.scala b/tests/pending/run/reflection-modulemirror-inner-badpath.scala new file mode 100644 index 000000000..de200c548 --- /dev/null +++ b/tests/pending/run/reflection-modulemirror-inner-badpath.scala @@ -0,0 +1,24 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.reflect.ClassTag + +class Foo{ + object R { override def toString = "R" } + def foo = { + val classTag = implicitly[ClassTag[R.type]] + val sym = cm.moduleSymbol(classTag.runtimeClass) + try { + val cls = cm.reflectModule(sym) + cls.instance + println("this indicates a failure") + } catch { + case ex: Throwable => + println(ex.getMessage) + } + } +} + +object Test extends App{ + val foo = new Foo + println(foo.foo) +} \ No newline at end of file -- cgit v1.2.3