aboutsummaryrefslogtreecommitdiff
path: root/tests/disabled/macro/run/t7375b/Macros_1.scala
blob: b6090e730b3ae95693beac050d48217d9f5bc536 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import language.experimental.macros
import scala.reflect.macros.blackbox.Context

class C1(val n: Int) extends AnyVal
class C2(val n: Int) extends AnyRef

object Macros {
  type F1 = C1
  type F2 = C2

  def foo = macro impl
  def impl(c: Context) = {
    import c.universe._
    def test[T: c.TypeTag] = reify(println(c.Expr[String](Literal(Constant(c.reifyRuntimeClass(c.typeOf[T]).toString))).splice)).tree
    def tests = Block(List(test[C1], test[C2], test[F1], test[F2]), Literal(Constant(())))
    c.Expr[Unit](tests)
  }
}