summaryrefslogtreecommitdiff
path: root/test/files/run/reify_closure8b.scala
blob: 431da3230e0045bdcc25d57e5872df36c7d233da (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import scala.reflect.mirror._

object Test extends App {
  // will fail because y is a private field
  // reification doesn't magically make unavailable stuff available
  class Foo(y: Int) {
    def fun = reify{y}
  }

  try {
    val dyn = mkToolBox().runExpr(new Foo(10).fun.tree)
    val foo = dyn.asInstanceOf[Int]
    println(foo)
  } catch {
    case ex: Throwable =>
      println(ex)
  }
}