def myNew[T] = macro myNewImpl[T]def myNewImpl[T: c.TypeTag](c: Context) = reify(<[ new T ]>)
I think in this case you'll need to construct the tree by hand ... the
following works for me,
def myNew[T] = macro myNewImpl[T]
def myNewImpl[T: c.TypeTag](c: Context) : c.Expr[Any] = {
import c.mirror._
Apply(
Select(
New(TypeTree().setType(c.tag[T].tpe)),
newTermName("<init>")),
List())
}
Cheers,
Miles
--
Miles Sabin
tel: +44 7813 944 528
gtalk: mi...@milessabin.com
skype: milessabin
g+: http://www.milessabin.com
http://twitter.com/milessabin
http://underscoreconsulting.com
http://www.chuusai.com