aboutsummaryrefslogtreecommitdiff
path: root/tests/disabled/macro/run/reify_newimpl_43.scala
blob: 736536cb30ce2cd13e9f49216cb8dbff0f908e32 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
      println(x)
      println(y)
    }
    code.eval
  }
}