aboutsummaryrefslogtreecommitdiff
path: root/tests/disabled/macro/run/reify_newimpl_52.scala
blob: 4dc82b145261aaddfef5c7919f660afb6a2a31ec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import scala.reflect.runtime.universe._
import scala.tools.reflect.Eval

object Test extends dotty.runtime.LegacyApp {
  {
    var counter = 0
    lazy val x = { counter += 1; counter }
    lazy val y = { counter += 1; counter }
    val code = reify {
      def foo = y // ensures that y is the first freevar we find
      val bar = reify { println(y * x) }
      bar.eval
      println(x)
      println(y)
    }
    code.eval
  }
}