summaryrefslogtreecommitdiff
path: root/test/files/run/macro-reify-freevars/Macros_1.scala
blob: 57fdc324372086c348721ac8549e7d4ba3403f9b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package scala.collection.slick

object QueryableMacros{
  def map[T:c.AbsTypeTag, S:c.AbsTypeTag]
         (c: scala.reflect.macros.Context)
         (projection: c.Expr[T => S])
         : c.Expr[scala.collection.slick.Queryable[S]] = {
    import c.universe._
    val code = EmptyTree
    c.universe.reify{
      Queryable.factory[S]( code.asInstanceOf[reflect.runtime.universe.Tree] )
    }
  }
}
class Queryable[T]{
  def map[S]( projection: T => S ) : Queryable[S] = macro QueryableMacros.map[T,S]
}
object Queryable{
  def factory[S]( projection:reflect.runtime.universe.Tree ) : Queryable[S] = null
}