1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
import scala.reflect.runtime.universe._
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
object Test extends App {
Macros.foo
val tb = cm.mkToolBox()
val classDef = ClassDef(
Modifiers(), newTypeName("C"), List(),
Template(
List(Select(Ident(newTermName("scala")), newTypeName("AnyRef"))), emptyValDef,
List(DefDef(Modifiers(), nme.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(Apply(Select(Super(This(tpnme.EMPTY), tpnme.EMPTY), nme.CONSTRUCTOR), List())), Literal(Constant(())))))))
tb.typeCheck(classDef)
}
|