blob: 71a96518e8ace7f362cc1d6f98591e9c30e5b88a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
|
import scala.language.experimental.macros
import scala.reflect.macros.blackbox.Context
object Macros {
def foo: Unit = macro impl
def impl(c: Context) = {
import c.universe._
val test1 = c.freshName()
val test2 = c.freshName("$")
q"println(List($test1, $test2))"
}
}
|