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

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

  def foo = macro impl
}