summaryrefslogblamecommitdiff
path: root/test/files/run/reflection-modulemirror-nested-badpath.scala
blob: 43cae00f9ce1c5c4494137ce1bc050d937b9e34d (plain) (tree)

























                                                  
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)
}