aboutsummaryrefslogtreecommitdiff
path: root/tests/disabled/macro/run/macro-sip19/Test_2.scala
blob: 0255f1381d79c78463334a20ea2efa3a6d885f6b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import Macros._

object Test extends dotty.runtime.LegacyApp {
  def foo(x: Int, y: Int)(implicit loc0: SourceLocation): Int = {
    var loc = loc0;
    {
      var loc0 = 0 // shadow loc0 to disambiguate with the implicit macro
      println("hey, i've been called from %s".format(loc))
      if (x < y) foo(y, x)
      else if (y == 0) x
      else foo(x - y, y)
    }
  }

  println(foo(4, 2))
}