aboutsummaryrefslogtreecommitdiff
path: root/tests/disabled/macro/run/macro-rangepos-args/Macros_1.scala
blob: 97b938613c5dfb1fb540a268dd53a16d07bf3d5f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
import scala.language.experimental.macros
import scala.reflect.macros.blackbox.Context

object Macros {
  def impl(c: Context)(x: c.Tree): c.Tree = {
    import c.universe._
    Literal(Constant(s"Line: ${x.pos.line}. Width: ${x.pos.end - x.pos.start}."))
  }
  def pos(x: Any): String = macro impl
}