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