blob: 08f1c21e89bf86b2747d882417646f0b01e56b82 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
import scala.language.experimental.macros
object Macros {
def impl(c: scala.reflect.macros.BlackboxContext) = {
import c.universe._
q"""
trait Foo {
def x = 2
}
new Foo {}
"""
}
def foo = macro impl
}
|