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