aboutsummaryrefslogtreecommitdiff
path: root/tests/pending/run/reflection-modulemirror-inner-badpath.scala
blob: 94c3c5e7b4b3cec80220c4e622afd8236b4d6257 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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 dotty.runtime.LegacyApp{
  val foo = new Foo
  println(foo.foo)
}