In a typed blackbox macro(implicit materializer), how do you check if a Type or Symbol is a tuple? There's the obvious solution of pattern matching or something like that, but is there an isTuple method that I can find anywhere?
So far I know I can do this:
def typed[A : c.WeakTypeTag]: Symbol = weakTypeOf[A].typeSymbol
object TupleSymbols {
val tuple2 = typed[(_, _)]
val tuple3 = typed[(_, _, _)]
// ... and so on
}
Is there a more sane approach than the above monstrosity?
scala.Tuple\d*? - Alexey Romanovtuple2etc. but I don't know if there are better alternatives. - Alexey Romanov