Skip to content

Instantly share code, notes, and snippets.

@stephanos
Forked from asouza/scala2.10-reflection
Created October 20, 2012 10:02
Show Gist options
  • Save stephanos/3922840 to your computer and use it in GitHub Desktop.
Save stephanos/3922840 to your computer and use it in GitHub Desktop.
Scala 2.10 new Reflection API
import scala.reflect.api._
import scala.reflect.runtime._
import scala.reflect.runtime.Mirror._
object Pimps {
implicit def pimp(str:String) = new {
def test = println("hello")
}
}
val aType:Type =
Mirror.typeOfInstance(Pimps)
val members: List[Symbol] =
aType.members
val justImplicits =
members.filter(member => member.hasModifier(Modifier.`implicit`))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment