From abc1c0be79ac2fb2b0e75c87a489570a9c71aa6e Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Fri, 8 Jun 2012 11:43:20 +0200 Subject: tests and fixes for the mirror API --- .../reflection-modulemirror-nested-badpath.scala | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 test/files/run/reflection-modulemirror-nested-badpath.scala (limited to 'test/files/run/reflection-modulemirror-nested-badpath.scala') diff --git a/test/files/run/reflection-modulemirror-nested-badpath.scala b/test/files/run/reflection-modulemirror-nested-badpath.scala new file mode 100644 index 0000000000..43cae00f9c --- /dev/null +++ b/test/files/run/reflection-modulemirror-nested-badpath.scala @@ -0,0 +1,26 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.reflect.ClassTag + +class Foo{ + import Test._ + def foo = { + val classTag = implicitly[ClassTag[R.type]] + val sym = cm.moduleSymbol(classTag.runtimeClass) + try { + val cls = cm.reflect(this).reflectModule(sym) + cls.instance + println("this indicates a failure") + } catch { + case ex: Throwable => + println(ex.getMessage) + } + } + +} + +object Test extends App{ + object R { override def toString = "R" } + val foo = new Foo + println(foo.foo) +} -- cgit v1.2.3