blob: edabb95ee34e5d862cb5ed7a6387f3b809448699 (
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.Context
import java.io.InputStream
object Macros {
def unpack[A](input: InputStream): A = macro unpack_impl[A]
def unpack_impl[A: c.TypeTag](c: Context)(input: c.Expr[InputStream]): c.Expr[A] = {
import c.universe._
def unpackcode(tpe: c.Type): c.Expr[_] = {
if (tpe <:< implicitly[c.AbsTypeTag[Traversable[_]]].tpe) {
}
???
}
unpackcode(c.typeOf[A])
???
}
}
|