How to check if WeakTypeTag or Type WeakTypeTag specific type? This would be especially useful in macros, where I could use it to raise a compilation error when the type specified by the user is not specific:
def macroMethod[T]: Unit = macro macroMethod_impl[T] def macroMethod_impl[T: c.WeakTypeTag](c: Context): c.Expr[Unit] = { import c.universe._ def isConcrete(tpe: Type) = ??? if(!isConcrete(weakTypeOf[T])) { c.error(c.enclosingPosition, "You must provide concrete type.") } c.literalUnit }
source share