summaryrefslogtreecommitdiff
path: root/test/files/run/t7008/Impls_Macros_2.scala
blob: 3c6fe116ce2ed14f089d2494feda7621b16bcd80 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
import language.experimental.macros
import scala.reflect.macros.blackbox.Context

object Macros {
  def impl(c: Context) = {
    import c.universe._
    val decls = c.typeOf[JavaClassWithCheckedExceptions_1[_]].decls.toList
    val s = decls.sortBy(_.name.toString).map(decl => (s"${decl.name}: ${decl.annotations}")).mkString(scala.compat.Platform.EOL)
    reify(println(c.Expr[String](Literal(Constant(s))).splice))
  }

  def foo = macro impl
}