Skip to content

Instantly share code, notes, and snippets.

@fwbrasil
Last active December 15, 2015 15:09
Show Gist options
  • Save fwbrasil/5279209 to your computer and use it in GitHub Desktop.
Save fwbrasil/5279209 to your computer and use it in GitHub Desktop.
import net.fwbrasil.smirror._
trait Foo {
@deprecated("foo is a terrible name! what were you thinking?", "0.1")
def foo(i: Int) = i
}
class Bar extends Foo {
}
object Test extends App {
import scala.reflect._
val clazz = classOf[Bar]
implicit val mirror = runtimeMirror(clazz.getClassLoader)
val randomMeth = clazz.getDeclaredMethods.head
println(randomMeth)
println(sMethod(randomMeth).symbol.annotations)
}
@fwbrasil
Copy link
Author

output:

public int test.Bar.foo(int)
List(scala.deprecated("foo is a terrible name! what were you thinking?", "0.1"))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment