summaryrefslogtreecommitdiff
path: root/test/files/run/reflection-modulemirror-nested-badpath.scala
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2012-06-08 11:43:20 +0200
committerEugene Burmako <xeno.by@gmail.com>2012-06-08 15:35:23 +0200
commitabc1c0be79ac2fb2b0e75c87a489570a9c71aa6e (patch)
tree5d2723fa39aa8b28337b1e005ae06891667580a2 /test/files/run/reflection-modulemirror-nested-badpath.scala
parent2123201e3cbc34676d2936226539bdfa0555c275 (diff)
downloadscala-abc1c0be79ac2fb2b0e75c87a489570a9c71aa6e.tar.gz
scala-abc1c0be79ac2fb2b0e75c87a489570a9c71aa6e.tar.bz2
scala-abc1c0be79ac2fb2b0e75c87a489570a9c71aa6e.zip
tests and fixes for the mirror API
Diffstat (limited to 'test/files/run/reflection-modulemirror-nested-badpath.scala')
-rw-r--r--test/files/run/reflection-modulemirror-nested-badpath.scala26
1 files changed, 26 insertions, 0 deletions
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)
+}