Last active
December 15, 2015 15:09
-
-
Save fwbrasil/5279209 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
output:
public int test.Bar.foo(int)
List(scala.deprecated("foo is a terrible name! what were you thinking?", "0.1"))