blob: c5bb44d87e821905a3727a6e288ea77df5bbfef7 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
import scala.reflect.macros.BlackboxContext
import java.io.InputStream
object Macros {
def unpack[A](input: InputStream): A = macro unpack_impl[A]
def unpack_impl[A: c.WeakTypeTag](c: BlackboxContext)(input: c.Expr[InputStream]): c.Expr[A] = {
import c.universe._
def unpackcode(tpe: c.Type): c.Expr[_] = {
if (tpe <:< implicitly[c.WeakTypeTag[Traversable[_]]].tpe) {
}
???
}
unpackcode(implicitly[c.WeakTypeTag[A]].tpe)
???
}
}
|