Is it possible to generate Apply from WeakTypeTag inside a scala macro?
问题 I have a WeakTypeTag of some type in my macro, and I want to generate code as follows: macroCreate[SomeObject] // => SomeObject(1) The definition of a macro will be something like this: def macroCreate[A] = macro _macroCreate[A] def _macroCreate[A](c: Context)(implicit wtt: c.WeakTypeTag[A]) = { c.Expr(Apply(Select(???, newTermName("apply")), List(c.literal(1).tree))) } The problem is, how do I get Select for the given type? I can use a workaround of converting the type to string, splitting